MIsty wrote:-opaque and +opaque will fill the unwanted regions with pure white?
That seems to be the default. You can make it explicit with the -fill option. Also, some threads I was just reading recommend putting the input image name before any of the options - not sure if that is still relevant or not.
ImageMagick will return a single number with the number of colours in a file. That can be read in to a variable, and used to decide which image layer files to delete since only blank images will ever return 1.
The opinions expressed in this post are my own and do not necessarily represent those of the Canadian Museum for Human Rights.
I've attached PDFMaker 0.2 to this post. It eliminates that ST Separator requirement, using ImageMagick. Unfortunately this is much slower than ST Separator was, but should be more compatible.
0.2 also includes preliminary code to pass the DPI on to pdf.py, but I haven't updated pdf.py yet to have it take advantage of it.
Does anyone know of a way to identify the number of colours in an image that would be faster than using ImageMagick's identify command?
Edit: I forgot to mention that I also added an option to customize JEPG compression quality. The default is 85. Specify quality with -quality X
% time identify -format %k 001.pnm
2
identify -format %k 001.pnm 6,79s user 0,33s system 99% cpu 7,188 total
% time gm identify -format %k 001.pnm
2
gm identify -format %k 001.pnm 2,30s user 0,11s system 98% cpu 2,440 total
That's quite an improvement. I hate to add another dependency, but I'll look at switching to GraphicsMagic. Thanks for the tip!
Edit: I wonder how GraphicsMagick's JPEG2000 compression is? Maybe I'll avoid the bug/quirk in ImageMagick. It would be nice to get JP2 compression reintegrated.
The opinions expressed in this post are my own and do not necessarily represent those of the Canadian Museum for Human Rights.
I was curious if you could send me a small-sized copyright-free PDF made from PDFMaker where I can test sending the whole doc in Illustrator LiveTrace as a complete vectorization test.
I suppose I'd like to try this on a compressed ebook with B/W line of art material & text.
A good mixed-bag of media in the PDF will be a great to try. No OCR on this yet, correct?
Also: Perhaps if there's a way to send different optimal compression levels with their specs; maybe the original uncompressed. Take your time on this, it's kind of a tall order to ask someone to do this pro bono. I appreciate it.
It will be a PDF I routinely test and learn with with if it's ok. By the time there's Mac UI on PDFMaker running, I'd have an idea how to mesh other ideas with or around it.
and another thing I was thinking about is how you developed PDFMaker with background removal/isolation.
Granted, I'm fairly green with all the in and outs of PDF construction, I did some tests with Acrobat and realized it can't differentiate and effectively remove the background from ST-generated images.
This isn't really noticed until the user decides to invert colors (e.g, white text on black background).
My question is this: did you manage to differentiate/isolate text/line art/pictures from the ST white background?
I isolated the background using ImageMagick/GraphicsMagick, which preprocess the files for PDF conversion. They include a -transparent option which allows a colour to be defined as transparent. When creating the image layer, I use -transparent white to remove every white pixel in the image; that way, the text layer is visible outside the image. As Tulon notes, pure white is not used for anything other than backgrounds in ST's output. There are also a few other options that work on defined colours, like -opaque and +opaque which select a colour (or any colour but the selected colour) and replace it with another colour. I create text-only pages by using -fill white +opaque black, which replaces anything that isn't pure black with white background. You could do your colour swap with the -negate option, which would invert every colour - including the background.
Unfortunately, it looks like I can't use GraphicsMagick for everything in PDFMaker. At the moment, it does not support transparency in PDFs. Do users mind having both ImageMagick and GraphicsMagick installed, or would people prefer to only need one installation even if that means a much slower conversion process?
The opinions expressed in this post are my own and do not necessarily represent those of the Canadian Museum for Human Rights.