View Single Post
Old 05-05-2007, 05:38 AM   #58
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:
Originally Posted by alex_d
P.S. For 16-color devices, the dithering won't make a big difference. For the 4-color sony, it does. White backgrounds get a light gray snow and black text gets a dark gray one. The end result is decreased contrast on a device which has poor contrast to begin with.
Hmm, I think that I'll go the image -> pngnq -> pnmremap route. What I'll do is add another command-line option, --grayscale-remap which will take a comma seperated list of values for the allowed pixel intensities. Then, during conversion I'll create the map dynamically and call pnmremap with it. I'll set it up so that the reader profiles have the proper values set properly. Do you think that's a good approach?

Quote:
Originally Posted by alex_d
Also, in regards to further tuning, I suggest you tweak your default settings a little. This may vary by device, but on my reader the best edge enhancement seems to be 7 not five, and you may want to change your default dilation factor. In fact, how exactly are you doing it right now? By setting a dpi and then multiplying by page size? That would give very inconsistent results if the size of the page is different from A4 (a good example is if one does manual cropping as one should, but also most pdf books are not a4).
Hmm, I think that 7 does a little too much edge-enhancement, but I'm willing to change it. Actually, what would be nice if someone could volunteer to test various parameters and report what looks the best. Any volunteers?

I also do dilation and resizing differently from RasterFarian. I render the PDF/DJVU at the dilation DPI, without specifying a page size. So Ghostscript or DJVU automatically create a image with size appropriate for that resolution. I don't know what the size is up front at all, and in fact it varies from book to book. I perform cropping/dilation at that DPI, and then depending on the mode I resize it down and split it up if necessary while maintaining the aspect ratio. This ensures that whatever may be the input page size it really doesn't matter to PDFRead -- what matters is the DPI, aspect ratio of cropped content and the mode.

BTW, I've already implemented everything except the "reflow" mode in SVN. I hope to have at least a rudimentary implementation done by tomorrow (I'll optimize for speed later).
ashkulz is offline   Reply With Quote