Circle thumbnails
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
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.
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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
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.
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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
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!
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.
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
Note the center can be 'off' the image.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Okay. I may have misinterpreted your request.
What is wrong with...
It does as you are describing. But you said it is "not working".
What is wrong with...
It does as you are describing. But you said it is "not working".
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
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!
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!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
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.
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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
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.
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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Circle thumbnails
The problem is all the users articals were for some reason deleted. presumably by the user himself.
This is a real pain for others.
This is a real pain for others.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Circle thumbnails
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:
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");