Brandon Clark
Brandon Clark

Reputation: 796

Imagemagick (convert: pixels are not authentic)

I have a command-line that outputs an image as intended but gives me an error on completion of convert: pixels are not authentic. Why could this be happening?

I am using ImageMagick 6.9.2-8 Q16 x86_64 2015-12-06 in Term2 on OSX El Capitan.

The command / output / error :

convert -verbose artwork.jpg -resize 1800x \
\( +clone -gravity center -background white -extent 2000x2000 \) \
\( -clone 1 displaceY.png -compose displace -define compose:args=0x5% -composite \)  \
\( -clone 2  -gravity west displaceX.png -compose displace -define compose:args=5x0% -composite \) \
-delete 0--2 \( +clone alpha.png -compose copy_opacity -composite \) -delete 0 out.png

artwork.jpg JPEG 2952x2124 2952x2124+0+0 8-bit sRGB 911KB 0.000u 0:00.000
displaceY.png PNG 2000x2000 2000x2000+0+0 8-bit sRGB 109KB 0.000u 0:00.000
displaceX.png PNG 2400x2400 2400x2400+0+0 8-bit sRGB 104KB 0.000u 0:00.000
alpha.png PNG 2000x2000 2000x2000+0+0 8-bit sRGB 63.9KB 0.000u 0:00.000
artwork.jpg=>out.png JPEG 2952x2124=>2000x2000 2000x2000+0+0 8-bit sRGB 572KB 0.000u 0:00.000

convert: pixels are not authentic `artwork.jpg' @ error/cache.c/QueueAuthenticPixelCacheNexus/4017.

Upvotes: 0

Views: 891

Answers (2)

Brandon Clark
Brandon Clark

Reputation: 796

No one can answer why this may have been happening but most could agree there is a better way of doing it, a few of these produce no error. It seems to be related to using clone request after a certain point in the chain.

Here are two commands that resolve this issue and provide the correct output image:

convert artwork.jpg +repage -thumbnail 1800x -gravity center -background white -extent 2000x2000 \
-gravity northwest displaceY.png +repage -compose over -compose displace -define compose:args=0x5% -composite \
-gravity northwest displaceX.png +repage -compose over -compose displace -define compose:args=5x0% -composite \
-gravity center alpha.png -compose over -compose copy_opacity -composite final.png

or

convert artwork.jpg +repage -thumbnail 1800x -gravity center -background white -extent 2000x2000 \
-gravity northwest displaceX.png displaceY.png +repage -compose over -compose displace -define compose:args=0x5% -composite \
-gravity center alpha.png -compose over -compose copy_opacity -composite final.png

Thanks to Fred over in the ImageMagick forums.

Upvotes: 0

Mark Setchell
Mark Setchell

Reputation: 208077

It's hard to debug without the files and without knowing what you are trying to achieve, but I'll say what I see and maybe that will help. Here is what I think you have in the various layers:

0 - artwork 1800px wide
1 - artwork extended to 2000x2000
2 - clone of (1)
3 - clone of (2)

and then we come to the last line... and you delete 0--2 which is suspicious, did you mean 0-2, because 0--2 is actually 0,1.

So what did you mean to have in your image list after this -delete 0--2, I mean, how many images? I guess you meant to have 1 left.

Then you clone it, why do you do that? You could just copy the opacity right onto it and then you wouldn't need a -delete at the end?

Upvotes: 1

Related Questions