Page 1 of 1

miff stream to multi-page PDF with mixed color depth...

Posted: 2013-05-29T14:47:06-07:00
by jawzx
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...) :

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
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!

Code: Select all

mogrify -type TrueColor -colorspace sRGB *.tif
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!

Re: miff stream to multi-page PDF with mixed color depth...

Posted: 2013-05-29T15:01:10-07:00
by fmw42
What version of IM? I think that was a bug I reported earlier that is currently fixed in the last release or two.

Re: miff stream to multi-page PDF with mixed color depth...

Posted: 2013-05-30T05:28:57-07:00
by jawzx
Currently running 6.8.5-6 2013-05-10 compiled from source on Ubuntu 12.04

update: just downloaded and compiled 6.8.5-8 and it works a charm! Thanks!