View Single Post
Old 04-19-2008, 11:40 PM   #2
nrapallo
GuteBook/Mobi2IMP Creator
nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.
 
nrapallo's Avatar
 
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
Quote:
Originally Posted by daqi View Post
I've been working on a txt2lrf program which
could work with any encoding.
The tool would first render the txt file, save the result to a gif image, and then embed all the GIFs to a LRF file.
I've studied the makelrf source code, and got everything almost done. But what I found was, the antialiased font doesn't work very well on the Sony Reader - not as good as pdflrf.
It seems pdflrf uses an Image Edge Enhancement algorithm to make the text 'bolder'. (I tried Sobel operator, but it didn't work very well.)

As I'm not quite familiar with image processing, I wonder if the source of pdflrf is available so that I can refer to it. I've been searching over the internet all day, but couldnt find it. Anybody could help?
The python source code for PDFRead 1.8.2 is located here. The main thread for PDFRead 1.8 can be found starting here.

The image routines used therein are supported by the Python Imaging Library (PIL).

In particular, to thicken the text, I use the following routine, in the module 'process.py':
Code:
""" perform image dilation """
def dilate(image):
  p('DILATE ')
  return image.filter(ImageFilter.MinFilter)
Another more simplistic method (not used in PDFRead) would be a simple blur of the image (perhaps at a higher dpi) as follows:
Code:
""" perform image blur """
def dilate_blur(image):
  p('DILATE_BLUR ')
  return image.filter(ImageFilter.BLUR)
Perhaps these will help.
nrapallo is offline   Reply With Quote