Page 1 of 1

Posted: 2006-12-11T10:56:55-07:00
by monsters
Hi,

Images are of course rectangular by nature. What you could do is cut a rectangle out of the center of the image, and then place a white mask, or transparent mask in the shape you desire ( a circle) over top of it.

Posted: 2006-12-13T22:46:47-07:00
by anthony
You may not realise it by what you do on the commandline can also be generally done in PHP or other API.

Look at IM Examples Alpha Compositing for a solution.
Specifically 'Dst_Out' as an erase method.
http://www.cit.gu.edu.au/~anthony/graph ... se/#dstout
This is basic alpha composition and usable by all API's.

Posted: 2006-12-14T16:53:59-07:00
by anthony
OH! you want to overlay a white circle over an image, not turn an image into a circle!

Ok change the 'Dst_Out' to 'Screen' then position the source image (white circle) using
a geometry setting with the compose.

As you are drawing the circle, you can also just draw the circle directly on your fire image!
the center of the circle will be somewhere off the image, but that should be no problem.

Posted: 2006-12-17T19:25:36-07:00
by anthony
Your -geometry is a resize, I assume you aleady have the circle the right size, so you want to position it, not resize it.
EG -geometry +73+84
to position the circle.

however just draw directly on your image would be a LOT easier!

Code: Select all

   convert  image.png   -fill white -draw 'circle 36,40,65,45'  image.png
You need to just work out the location of the center and a point on the edge of the circle.
Note the center can be 'off' the image.

Posted: 2006-12-18T17:48:36-07:00
by anthony
Okay. I may have misinterpreted your request.

What is wrong with...
Image

It does as you are describing. But you said it is "not working".

Posted: 2006-12-19T18:25:37-07:00
by anthony
Two posible reasons...
1/ the original image does not have any alpha channel... add one using -matte
2/ you are saving to a format that does not use an alpha channel, EG: jpeg!

Posted: 2006-12-25T18:27:11-07:00
by anthony
what version of IM are you using?

Can you give us the commands with all the variables filled in? It is very hard to diagnose without all the details, and having to fill in the varables.
You can get a copy of the commands by adding a 'set -v;' to the start of each system call
so the command exectuted is 'verbosely' output to the caller.

Posted: 2006-12-29T23:00:03-07:00
by anthony
Some basic rules to start with...

First I would not use GIF as an intermediate format. A final format yes ,but not a working format. Use PNG or MIFF, instead.

Second after the -crop, do a +repage to remove any old 'virtutal canvas' that may linger.

Thrird read in images BEFORE applying resize or crop or any other image effecting operation on them.

And finally is your white_mask.png a white (or some other color) circle on a transparent background? You don't have the code generating it.

Re: Circle thumbnails

Posted: 2008-08-17T20:45:58-07:00
by anthony
The problem is all the users articals were for some reason deleted. presumably by the user himself.

This is a real pain for others.

Re: Circle thumbnails

Posted: 2008-08-18T14:40:17-07:00
by Bonzo
There are some php examples on my site - see my signature - including some circle example. Some of them could probably do with a tidy up.
Confirm what you want to do. This example of Anthony's can be written like this using php and the comand line:

Code: Select all

 exec("convert image.png -fill white -draw 'circle 36,40,65,45'  image.png");