Version: ImageMagick 6.8.9-7 Q16 x86_64 2014-08-27 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules
Delegates: bzlib cairo fftw fontconfig freetype gslib jbig jng jp2 jpeg lcms lqr ltdl lzma openexr png ps rsvg tiff webp x xml zlib
I am getting a very strange result from a displacement map saved as PNG compared to the same displacement map saved as TIF. The commands for doing the displacement are identical except for the format of the displacement maps and those compare closely.
PNG displacement image:
http://www.fmwconcepts.com/misc_tests/d ... splace.png
TIF displacement image:
http://www.fmwconcepts.com/misc_tests/d ... place.tiff
Code: Select all
compare -metric rmse displace.png displace.tiff null:
Image to be displaced:
Commands:
roll="+43.8596+0"
length2="51.1111"
pwidth="3157.89"
pheight="450"
height1="323.77"
xc="1578.94"
radius2="93.77"
width="300"
convert -respect-parenthesis \
\( gabby.jpg -write mpr:comp +delete mpr:comp \
-gravity center -background none -extent ${pwidth}x${pheight} -roll $roll \
-resize 100x${length2}% -background none -gravity northwest -extent ${pwidth}x${height1} \) \
displace.png -channel rgba -alpha on -virtual-pixel transparent -gravity northwest \
-define compose:args=${xc}x${radius2} -compose displace -composite -compose over \
-gravity center -crop ${width}x${height1}+0+0 +repage testpng.jpg
convert -respect-parenthesis \
\( gabby.jpg -write mpr:comp +delete mpr:comp \
-gravity center -background none -extent ${pwidth}x${pheight} -roll $roll \
-resize 100x${length2}% -background none -gravity northwest -extent ${pwidth}x${height1} \) \
displace.tiff -channel rgba -alpha on -virtual-pixel transparent -gravity northwest \
-define compose:args=${xc}x${radius2} -compose displace -composite -compose over \
-gravity center -crop ${width}x${height1}+0+0 +repage testtif.jpg
P.S. I suppose it is possible that the problem is when saving the displacement maps. But the code is the same except for the format.
I have a vertical displacement image and a horizontal displacement image both in .MPC format. The commands to save as the final displacement maps are:
Code: Select all
convert $tmpA4 $tmpA3 \( -clone 0 -fill black -colorize 100 \) -colorspace sRGB -combine -alpha set PNG32:displace.png
convert $tmpA4 $tmpA3 \( -clone 0 -fill black -colorize 100 \) -colorspace sRGB -combine -alpha set displace.tiff