cropping to a circular region?

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
User avatar
mouldy
Posts: 663
Joined: Wed 04 May 2005, 21:47

cropping to a circular region?

#1 Post by mouldy »

Can either xpaint or mtpaint outline a circular/oval region and crop everything around that region? If so, how? If not then would one have to somehow make the unwanted white retangular corners transparent? How? Closest I can come is to freehand around object (not smooth) and end up with white corners. Seems if possible a tool allowing one to select a circular region, then crop to just that region would be quite handy.

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#2 Post by GuestToo »

you can draw elipses with mtpaint:

outline a rectangular selection

click Selection, Outline Elipse
or press ctrl+L
or click the Outline elipse button

you can save selections to mtpaint's clipboard
and use transparency masks

there must a better way to do this than what i'm doing

http://tinypic.com/53a35d

http://tinypic.com/53a39g

http://tinypic.com/53a3bp

User avatar
mouldy
Posts: 663
Joined: Wed 04 May 2005, 21:47

#3 Post by mouldy »

Ok, I can box portion of pic I want, crop it, and create red elipse inside box with mtpaint.

Now do I have to manually color out the parts outside the elipse? Either you have steady hand to color things out or there is an automatic way to color everything outside elipse.Then how do I apply the transparency mask? I cant find any tool mentioning/showing transparency? There is "mask all" in menu, but it just puts x beside all the colors in left hand column. You sort of glossed over everything after the red elipse. I looked for info on mtpaint and just found one text page sort of hitting highlights of its abilities. No real howto or man pages.

Rich
Posts: 278
Joined: Wed 04 May 2005, 19:00
Location: Middlesbrough - UK

#4 Post by Rich »

Try this.
Open Xpaint and load your image as usual.
In the selector box with the 3 pencils at the top of it, click on the blue icon at the bottom of the left hand column, the one with a dotted square and circle. This is the geometric selection tool.
Then, right click the same icon and select ellipse from the drop down menu.
You now have an ellipse selector tool chosen.
Go across to the image and select the area you want to keep.

Then, go to the edit menu above the pic and select cut. This removes the selected area from the screen, leaving you with a white circle in the middle of the pic.

Next, in the edit menu again, click on Select All ( selecting the whole thing ) , then press Delete on the keyboard. This removes the image completely, leaving you with a blank canvas.

Fimnally, back to the edit menu again and select ' Paste' , putting the circular/elliptical selection back on the canvas.

It's a bit of a 'round the houses' way of doing it, but seems to work OK.


Rich

User avatar
mouldy
Posts: 663
Joined: Wed 04 May 2005, 21:47

#5 Post by mouldy »

Rich wrote:Try this.
Open Xpaint and load your image as usual.
In the selector box with the 3 pencils at the top of it, click on the blue icon at the bottom of the left hand column, the one with a dotted square and circle. This is the geometric selection tool.
Then, right click the same icon and select ellipse from the drop down menu.
You now have an ellipse selector tool chosen.
Go across to the image and select the area you want to keep.

Then, go to the edit menu above the pic and select cut. This removes the selected area from the screen, leaving you with a white circle in the middle of the pic.

Next, in the edit menu again, click on Select All ( selecting the whole thing ) , then press Delete on the keyboard. This removes the image completely, leaving you with a blank canvas.

Fimnally, back to the edit menu again and select ' Paste' , putting the circular/elliptical selection back on the canvas.

It's a bit of a 'round the houses' way of doing it, but seems to work OK.


Rich
Ok, didnt know about drop down menu. Works great, however I still get the "white corners" on the saved cutout region. How do I make them transparent? Just as an example, look at pic I temporarily posted as my avatar. How to get rid of white corners.

Rich
Posts: 278
Joined: Wed 04 May 2005, 19:00
Location: Middlesbrough - UK

#6 Post by Rich »

OK then............

if it's a jpeg then it's gotta be square/rectangular. However, if you look at your desktop then you see that the icons ( xpm format ) have transparent backgrounds.
So you need the pic to be in xpm format really.

Easiest way to do this is to open mtPaint icon editor and load the pic with that - the new, circular pic with the white background. Select Image in the drop down menu and ( if the option is enabled ) choose 'Convert to Indexed'. This enables you to save the pic as an xpm file.

Now all you have to do is tell it which colour the background is. If the background ( white at the moment ) matches anything in the actual graphic that you don't want transparent then select an unused colour and fill the background in with that one. On the left of the screen there's a colour list where all the colours are numbered. Let's assume that you went for a tasteful lime green colour for the background - and it's colour number 11 on the list.
From the drop down menu, choose 'Image - Preferences' ( ctrl-P ).
Click the Files tab at the top of the preference screen, then change the XPM transparency index to 11 ( the one matching the background colour ) .
Save the file and you're done.

Rich
( phew ! ) :P

EDIT - Just tried it with your Avatar. As it's a gif image then it's already an indexed file, so load it with the icon editor, change the xpm transparency index to 6 ( white ) and then Save As an xpm file.

User avatar
mouldy
Posts: 663
Joined: Wed 04 May 2005, 21:47

#7 Post by mouldy »

Ok, tried what you said and it works. Be fine for Puppy desktop icon. :D :D :D However useless as an avatar where I am restricted to jpg, png, or gif. :( Also xpm is bloated considerably compared to the others so even if it was accepted, it would have to be teeny tiny to meet size limitations. :(

Post Reply