Quote:
Originally Posted by daqi
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.