KaniyamFoundation / ProjectIdeas

A Place to write down the project ideas and to plan them
40 stars 3 forks source link

Create a command line tool to create ebooks cover images automatically #35

Open tshrinivasan opened 5 years ago

tshrinivasan commented 5 years ago

We need cover images for 1000 ebooks. read here - http://www.kaniyam.com/call-for-donation-to-buy-1000-books-in-unicode-format/ https://goinggnu.wordpress.com/2019/03/08/call-for-donations-to-buy-1000-ebooks-in-unicode-format/

We have to create cover images for all these 1000 ebooks. Making them manual will take more time.

We need a command line tool to create cover images automatically. Input will be a CSV file with

bookname,author,category

details.

Create some 10 base templates select a random template fill it with above details create cover image JPG

Resolution = 1562 x 2316 pixels

Check http://FreeTamilEbooks.com for the cover images that are created manually.

tshrinivasan commented 5 years ago

@suddharshan is working on this.

https://github.com/suddharshan/creating-book-cover-using-python

tshrinivasan commented 5 years ago

here is the list of books https://docs.google.com/spreadsheets/d/10Z6sfn7C9KuHn8O1RfGfQGkk_RN4jwLeL__cF3T-b5Q/edit?usp=sharing

neechalkaran commented 4 years ago

https://github.com/neechalkaran/tamilwrappermaker Basic workable prototype is ready. It is without Tamil rendering issue.

Expected Needs Need to know the standard format of input for books/ author details. csv or other confirm the standard for file name of the jpeg image

Optional Needs list of background images list of TSCII fonts

tshrinivasan commented 4 years ago

We can use pyvips library to create images with unicode itself.

sample code is here https://github.com/JaidedAI/EasyOCR/issues/39#issuecomment-659949561

sudo apt-get install libvips-dev libvips-tools libvips42 sudo pip3 install pyvips

code: test.py import pyvips text_string = 'வணக்கம்' image = pyvips.Image.text(text_string, dpi=3000, font='Vijaya', \ fontfile="/home/shrini/dev/fte/create_ebooks/fonts/Vijaya.ttf") image.write_to_file("text.png")

result image : text

tshrinivasan commented 4 years ago

we have to explore pyvips or PIL to set dimentions, color and location of the text. sample code here - https://github.com/JaidedAI/EasyOCR/issues/39#issuecomment-659949561

tshrinivasan commented 1 year ago

https://github.com/alauvdheen/pythontamilfont

Here is a pythonic way of showing unicode tamil fonts properly in PDF and images.

gurulenin commented 1 year ago

Inkscape can achieve this with the help of a plugin called NextGenerator (https://inkscape.org/~Moini/%E2%98%85nextgenerator-replace-export).

I am utilizing this plugin to create bulk ID Cards.