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

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
jawzx
Posts: 11
Joined: 2013-04-24T14:17:28-07:00
Authentication code: 6789

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

Post 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!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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.
jawzx
Posts: 11
Joined: 2013-04-24T14:17:28-07:00
Authentication code: 6789

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

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