miff stream to multi-page PDF with mixed color depth...
Posted: 2013-05-29T14:47:06-07:00
Ok, so I'm trying to do this with a miff stream for expediency, but if I have to write out temp files it won't be the end of the world, i'll just put that up front 
so, basically this is the psudocode i'm using (there's more to it, but these are the relevant bits...) :
where the input of my loop is tif files, some of which are sRGB, some of which are greyscale. When outputing the final multi-page PDF the pages generates with the sRGB tifs look fine, the greyscale tifs are squished laterally, (tall and thin) and all green. Fine! I say; it's an issue with them being in greyscale!
Identify now returns that all tifs are INDEED sRGB 8-bit color...
Run the code again...
Same thing! Greyscale pages are wonky :p
Any hints?
Thanks!

so, basically this is the psudocode i'm using (there's more to it, but these are the relevant bits...) :
Code: Select all
for f in $*
do
convert -size 3600x4500 xc: -gravity center -colorspace sRGB -draw \
"image over 200,0 2900,4100 '$f'" -draw "image over 0,-1500 0,0 \
'/foo/bar/imagewithtransparency.png'" \
-pointsize 100 -draw "text 1400,2100 'PAGE $number'" \
-pointsize 50 -font /usr/share/fonts/somefont1.ttf \
-draw "text 0,-2100 'example header'" -font /usr/share/fonts/somefont2.ttf\
-draw "text 0,0 'some other text that may be read from an xml file'" \
+depth miff:-;
let number=$number+1
done | convert - -compress jpeg -density 300 testbook.pdf
Code: Select all
mogrify -type TrueColor -colorspace sRGB *.tif
Run the code again...
Same thing! Greyscale pages are wonky :p
Any hints?
Thanks!