Sometimes I play around with translating manga for fun. It doesn’t really seem to get me much of anything except for lots of requests from punks to translate their favorite naruto doujinshi, but it is fun and relaxing with the bonus that I learn some cool casual Japanese.
I like to translate with a program I wrote for manga translation that puts all the text in the bubbles and whatnot, so I need to have scans of the manga to work from. So sometimes I’ll scan manga.
The problem is that the scanner I have now doesn’t do a great job of getting nice clean images. I often use (when I’m not feeling too lazy) pnyxtr’s scan cropping program and his great scan rotation program, but if you have nasty scans that doesn’t help much.
Since I’m both poor and lazy, and have a small amount of moral fiber, I use The Gimp for my image-editing needs. The Gimp has a nice scripting interface using a kind of baby scheme, so I wrote a script that will take a grayscale image, run the despeckle filter on it, re-level the image so that whites are whiter and blacks are blacker, then resizes the image to a reasonable size and converts it to a fixed number of colors. That makes the straight scanner output look just dandy, if you choose proper values for the high and low thresholds, and also automates a lot of clicking that I would have to do otherwise.
So in the off chance that anyone is interested, here is a Gimp script that will do all of that. If you place it in your proper gimp script location – on Linux or Mac OSX that would be ~/.gimp-2.2/scripts/ (or possible ~/.gimp-2.0/scripts/), and on Windows if you use the version of Gimp that I am using you can look in its application folder for something like a share/scripts folder and drop it there. On your next start-up of the Gimp you should see a new Script entry “Manga->DarkenResize” that will pop up a dialog and ask you for some values, with reasonable defaults specified.
You can get the script here: mangaDarkenResize.scm
One thing that annoys me is that I still have to manually set each picture to “Greyscale” mode. I should be able to do this automatically, but I don’t know much about the Gimp, so I’m punting on that for now. It is also possible to use the Gimp in a batch processing mode, which would be totally awesome, but I haven’t had time to make that work with this script. If someone makes any headway on that area, please let me know.
Leave a Reply