View Single Post
Old 04-04-2007, 11:54 PM   #44
ashkulz
Addict
ashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enough
 
ashkulz's Avatar
 
Posts: 350
Karma: 705
Join Date: Dec 2006
Location: Mumbai, India
Device: Kindle 1/REB 1200
Quote:
ashkulz, why don't you do what I do and bundle all supporting programs with the script? Maybe python can't be bundled, but at least bundle xpdf so that "no, don't use 3.00, use manually compiled 3.01" could be avoided.
Well, I *do* bundle it for Windows (see the installer). sammykrupa is on OS X, which is why all this is required -- I don't have access to OS X, and installing private versions of tools is very hard to implement on non-Windows systems, and not recommended at all. It's much better to let the native package management system handle the installation and upgrade process for the individual tools.

Quote:
The stuff that you did with auto-adjusting autocropping sounds cool. I haven't taken apart your stuff yet. How do you do it? You do the cropping directly with xpdf or you rasterize and then use image tools? How do you make measurements/calculations? Also, i'm confused... do you use ghostcript or xpdf? Could you maybe post a quick summary of your toolchain either here or on the "pythonized pdfrasterfarian" thread?
Okay, will answer one by one:
  • I use xpdf to convert from pdf -> ps, and then rasterize that from Ghostscript
  • I don't use the Ghostscript cropbox detection at all, though you can enable it by --gscrop. I had problems with it when the PDF already had a CropBox which covered prepress marks.
  • I use the PIL to detect all the "white" space surrounding an image, and directly crop that. This is very fast and accurate -- unless you've got a scan (where there may be some noise) it will remove all of the whitespace (even more than what is detected by Ghostscript). I plan to add noise elemination and more agressive cropping (similiar to what curiouser did) soon.

I'll mention the technical details in the other thread.
ashkulz is offline   Reply With Quote