Skip navigation

Tag Archives: imagemagick

I just watched The Last: Naruto The Movie a couple of days ago and I recalled that it’s been almost a quarter of decade since I last read the mangascan.

Reading Naruto in Kindle

Reading Naruto in Kindle

So I got a complete 2GB of mangascan pictures from my friend from volume 1 until volume 72. I’ve been a fan of Kindle e-book reader and I want to read the mangascan in my Kindle device. Here’s how I converted the PNG and JPG files to PDF so it can be readable in Kindle.

Basically what I need is imagemagick library to convert the images to PDF. Here is how to use the imagemagick to do the conversion.

As long as the JPG/PNG files is named with proper file naming, doing a batch conversion in zipped files is as simple as this. It shouldn’t take too long to convert all of the images to PDF. In my case it took less than an hour. The quality of the PDF is not that bad, but I think we can configure the imagemagick to increase the quality. I assume it reduces the quality by a bit.

for zipfile in $(find . -type f -iname "*.zip" | sort -n); do
    echo "$zipfile"
    filename=$(basename "$zipfile")
    echo "$filename"
    unzip $zipfile -d $filename
    echo "Converting...."
    find $filename | sort -n | tr '\n' ' ' | sed "s/$/\ ${filename}.pdf/" | xargs convert -verbose

See? Pretty simple, right? (The fact that it’s really simple is why I posted here. Might be useful for me in the future).

%d blogger menyukai ini: