problems with fx operator
Posted: 2015-03-16T11:58:31-07:00
i observe a change in behaviour from version 6.6.9-7 to 6.7.7-10 :
i am generating a panorama from a sky image with lookup tables, lutX.png and lutY.png
In the older version the result is in color on the newer i get a grayscale image.
The call in bash is as follows
$wraw, $hraw are width and height of the raw image.
example images can be found here
http://gop.meteo.uni-koeln.de/~hatpro/j ... ge_magick/
the full code with variables and lookup tabels is:
am i doing wrong or is it convert ?
i am generating a panorama from a sky image with lookup tables, lutX.png and lutY.png
In the older version the result is in color on the newer i get a grayscale image.
The call in bash is as follows
Code: Select all
convert lutX.png lutY.png raw.jpg -fx "u[2].p{ u*$wraw , v*$hraw }" pan.jpg
example images can be found here
http://gop.meteo.uni-koeln.de/~hatpro/j ... ge_magick/
the full code with variables and lookup tabels is:
Code: Select all
# width and height or original image
wraw=$(identify -format %w raw.jpg)
hraw=$(identify -format %h raw.jpg)
# simple estimate for center and radius
cx=$(($wraw/2))
cy=$(($hraw/2))
rad=$cx
# desired width and height of panorama
# panorama length = raw image width
wpan=$(( $wraw ))
# height is something
hpan=$(( $wpan * 100/628 ))
; generate lookup table for x coordinate
convert -size $wpan'x'$hpan xc: -channel G -fx "($cx-$rad*j/$hpan*sin(2*pi*i/$wpan))/$wraw" -separate lutX.png
; generate lookup table for y coordinate
convert -size $wpan'x'$hpan xc: -channel R -fx "($cy+$rad*j/$hpan*cos(2*pi*i/$wpan))/$hraw" -separate lutY.png
# do the pano
convert lutX.png lutY.png raw.jpg -fx "u[2].p{ u*$wraw , v*$hraw }" pan.jpg