First of all, let me say that switching to ImageMagick from JAI was one of the smartest things I've ever done. JAI is great. But, ImageMagick is stellar.
I've run into a problem though. We came across a need to combine two images. We have a placeholder that an image needs to go in which forces images to a certain size. But, the images we need to put there start really small so when we use IM to scale them, we wind up with an image you can no longer decipher (image is just way too small to start with). So, we want to create a blank image that is the right size and then put our super small image in the center of that blank image so that it does not get interpolated later.
We followed the example from the developer manual with the rose.jpg (composite -gravity center smile.gif rose: rose-over.png). That combined images just great. But, when we create a blank image, it does not. Can someone help me out? When we run this: composite -gravity center smile.gif convas: convas-over.png "Convas" is a blank image one of our developers created for the last test. We can create the blank canvas just fine. We can run the smile and rose example just fine. But, when we try to composite our created blank image with any other image, we get this:
Magick: no decode delegate for this image format `' @ error/constitute.c/ReadImage/532.
Magick: missing an image filename `convas-over.png' @ error/composite.c/CompositeImageCommand/1607.
We have checked and have all delegates. Can someone help me see what is wrong?
Best,
Al
Composite errors on blank image
-
- Posts: 1015
- Joined: 2005-03-21T21:16:57-07:00
Re: Composite errors on blank image
There is no canvas:, or convas:, pseudo image format. If you want a blank image you must use the -size option with the xc: pseudo format.
You can use the convert command to do the same thing but then the input file arguments are the other way round :
Pete
Code: Select all
composite -gravity center smile.gif -size 100x100 xc:black canvas-over.png
Code: Select all
convert -size 100x100 xc:black -gravity center smile.gif -composite canvas-over.png
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
See my message in this topic for a link to a zip of all the files.
Re: Composite errors on blank image
I would use Pete's convert example as you can do more with convert if you need to and you can composite more than one image where composite will only do two.
Re: Composite errors on blank image
It seems now there is:el_supremo wrote:There is no canvas: [...] pseudo image format.
http://www.imagemagick.org/script/formats.php (search for 'CANVAS')
Looks like an alias of xc: for the next IM version..?
But socialkast_al probably wanted to use a blank image that he created before. So, he should have replaced 'convas:' with the real file name:
composite -gravity center smile.gif convas.png convas-over.png
Or whatever his file is called..
But I would prefer Pete's line with convert, too.
-
- Posts: 1015
- Joined: 2005-03-21T21:16:57-07:00
Re: Composite errors on blank image
I would've sworn it wasn't in that list just a minute or so before I posted that statement.There is no canvas: [...] pseudo image format.
As Drarakel says, it looks like an alias of xc:, so in my examples canvas:black and xc:black will accomplish the same thing.
Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
See my message in this topic for a link to a zip of all the files.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Composite errors on blank image
Their is no 'coder' module specifically for canvas, but the XC: coder module is now registering itself as the coder for both 'xc' and 'canvas' image file formats. As such I would say they really are aliases.
However I have requested confirmation of this as there also is no ChangeLog entry for the addition.
The documentation should be updated when I get that confirmation.
However I have requested confirmation of this as there also is no ChangeLog entry for the addition.
The documentation should be updated when I get that confirmation.
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: Composite errors on blank image
I now have confirmation xc: ("X Constant Image") and canvas: are one and the same.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/