convert: pixels are not authentic

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
weblife
Posts: 21
Joined: 2016-01-06T22:23:33-07:00
Authentication code: 1151

convert: pixels are not authentic

Post by weblife »

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 happen? How could I resolve this?

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

The command :

Code: Select all

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.
Last edited by weblife on 2016-01-07T00:28:47-07:00, edited 3 times in total.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: convert: pixels are not authentic

Post by fmw42 »

convert 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
I believe you can put both displace images in one command. I do not see why you need to clone the resized image. Your -delete 0--2 may be wrong and perhaps should be -delete 0-2. Your -delete 0--2 deletes everything but the second to last image. I have not studied your command too well to know why you use that.

try

Code: Select all

convert artwork.jpg -resize 1800x -gravity center -background white -extent 2000x2000 \
displaceX displaceY.png -compose displace -define compose:args=0x5% -composite \
alpha.png -alpha off -compose copy_opacity -composite out.png
weblife
Posts: 21
Joined: 2016-01-06T22:23:33-07:00
Authentication code: 1151

Re: convert: pixels are not authentic

Post by weblife »

@fmw42 Thank you for the response. Your command didn't resolve the issue and changed the intended output but I will attempt to combine the displace's as you suggest and see if that helps. The -delete 0--2 is removing all index images up to the 2nd to last so I could try -delete 0-3.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: convert: pixels are not authentic

Post by snibgo »

Please also say what version of IM you are using. I haven't seen that message in a long time, suggesting an old version of IM.

"-delete 0--2" should leave two images in the list. You then clone the last, then delete the first. So you should have two outputs.
snibgo's IM pages: im.snibgo.com
weblife
Posts: 21
Joined: 2016-01-06T22:23:33-07:00
Authentication code: 1151

Re: convert: pixels are not authentic

Post by weblife »

@snibgo Thank you I forgot, added to original post. I do have two left but I call another -delete 0 before it finishes.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: convert: pixels are not authentic

Post by fmw42 »

From http://www.imagemagick.org/Usage/basics/#list_ops:

"The arguments to these operators are numbers indexing the image list, starting with zero ('0') for the first image, and one ('1') for the second image, and so on. However if you give a negative index, the images are referenced from the end (last image added) of the image list. That is a index of '-1' is the last image in the current image list (generally the last image read or created), '-2' for the second last and so on.
...
The '0--1' argument means delete images from first image (index 0) to the last image (index -1). In other words ALL images in the current image list."

So -delete 0--2 will leave only the last image in the list. In your case, you have 4 images total before the -delete 0--2, since you have the input image, +clone (same as -clone 0), -clone 1, -clone 2. The delete thus leaves only the last image from the -clone 2 step. Is that what you wanted?

All of your image should be the same size.

But try (I had left off -gravity east and the .png on displaceX.png before):

Code: Select all

convert artwork.jpg -resize 1800x -gravity center -background white -extent 2000x2000 \
-gravity east displaceX.png displaceY.png -compose displace -define compose:args=0x5% -composite \
alpha.png -alpha off -compose over -compose copy_opacity -composite out.png
or try:

Code: Select all

convert artwork.jpg -resize 1800x -gravity center -background white -extent 2000x2000 \
\( displaceX.png -gravity east -crop 2000x2000+0+0 +repage \) \
 displaceY.png -compose displace -define compose:args=0x5% -composite \
alpha.png -alpha off -compose over -compose copy_opacity -composite out.png
replace east with however you need to use the 2000x2000 region from the 2400x2400 of displaceX.png. Note after the -compose displace, I have used -compose over to reset the compose method before using -compose copy_opacity. This may not be needed, but some compose methods get confused if -compose is not reset to over before using them. This is particularly important before -flatten.

I am on IM 6.9.3.0 Q16 Mac OSX snow leopard
weblife
Posts: 21
Joined: 2016-01-06T22:23:33-07:00
Authentication code: 1151

Re: convert: pixels are not authentic

Post by weblife »

@fmw42 Thank you. I can resize that asset down to the 2k aspect. Your commands don't product what I need but it did narrow down the issue to the the use of clone. Trying to rework the command now.

It would help to explain I have three commands that can be ran in order to product the result but am trying to compact them into one.

Code: Select all

convert artwork.jpg -thumbnail 1800x -gravity center -background white -extent 2000x2000 out1.png

convert out1.png \
\( -clone 0 displaceY.png -compose displace -define compose:args=0x5% -composite \) \
\( -clone 1 displaceX.png -compose displace -define compose:args=5x0% -composite \) \
-gravity center -delete 0--2 out2.png

convert out2.png alpha.png -compose copy_opacity -composite final.png
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: convert: pixels are not authentic

Post by fmw42 »

This should work. You may be able to remove the -compose over and/or +repage in one or more places. But I have added them in just to be safe. If you provide your input images and working output image, then I could test these out.

Code: Select all

convert artwork.jpg +repage -thumbnail 1800x -gravity center -background white -extent 2000x2000 \
\( -clone 0 displaceY.png +repage -compose over -compose displace -define compose:args=0x5% -composite \) \
\( -clone 1 displaceX.png +repage -compose over -compose displace -define compose:args=5x0% -composite \) \
-gravity center -delete 0--2 \
alpha.png -compose over -compose copy_opacity -composite final.png
But you should not need the parens, so this should also work

Code: Select all

convert artwork.jpg +repage -thumbnail 1800x -gravity center -background white -extent 2000x2000 \
displaceY.png +repage -compose over -compose displace -define compose:args=0x5% -composite \
displaceX.png +repage -compose over -compose displace -define compose:args=5x0% -composite \
-gravity center alpha.png -compose over -compose copy_opacity -composite final.png
If this does not work, then try resetting the gravity

Code: Select all

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

Code: Select all

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
weblife
Posts: 21
Joined: 2016-01-06T22:23:33-07:00
Authentication code: 1151

Re: convert: pixels are not authentic

Post by weblife »

@fmw42 The last two commands work nearly perfect without the error message. I need to look a bit closer because there is some alteration from what I was producing. Thank you very much.
Post Reply