[Crop] [Gutter] [Bent lines] [Dirt] [Curves] [Resize & Unsharp] [PNG Save]
Making the final save

In manga editing, and any image editing, there is always conflict between image quality and filesize. We've got a lot of space on the server, but all these zips add up. We try to keep zip size below 4 MB, but it would be even nicer to keep chapter zips around 3 MB. Obviously, for every three 4 MB chapters you could have instead four 3 MB chapters.

If you just save jpgs at lower quality, you can get to 3MB or below, but quality is obviously going to suffer. Up till now I have been recommending saving jpgs at quality 5 progressive scans 5 (or at least optimized) and no lower. But I'm not going to recommend jpgs any more at all, except for color scans which should be saved no lower than quality 7. Why? Because something better exists without all those nasty jpg compression artifacts.

At this link is a 300% zoom on the finished version of this page, saved as jpg quality 5. And here is a 300% zoom of the PSD. I assume you can tell the difference. Can you tell without zooming? Well here is the full jpg, and here is the lossless png identical to the PSD in image data. Flip back and forth between them a couple times and you can probably see that the jpg has cloudiness around the lines (it is especially noticeable around the text—jpgs were never meant for line art or text display).

If we could save as lossless png all the time that would be the ideal. However, the jpg is 172K and the png is 272K. A chapter of lossless pngs would be probably 5 MB on the low side, so it's not so practical. (If, however, you care nothing about server space, skip ahead to the part about pngcrush in order to find out how to get optimum png compression.) What is practical, however, is a png with a reduced color table. A normal greyscale 8-bit png (and jpg) will have 256 colors. But manga is printed with just one color of ink: black, on off-white paper. Perceived greys in manga come from tones, which become greys when you scan and shrink them, but the idea behind reduced-color pngs is that with far fewer colors you can get picture quality just about the same as the full 8-bit png and better than a jpg.

Compare this color-reduced version of the previous lossless png image of the finished page. Flipping back and forth you will probably be able to tell that they are different but you may have difficulty judging one to be any better than the other. Here is the zoom at 300% of the reduced-color png. It should be obvious how much better than the zoomed jpg it is. The final png is 152K, which should indicate that 3 MB chapters with good quality are attainable.

Making the PNG
In order to make the png, use Save For Web. Pick it from the File menu. Select the Optimized tab. The settings to use are like the picture on the right. Use PNG-8 for format, Adaptive for palette, Diffusion for dither type, and Dither at 100%. 17 Colors; Interlaced off; Transparency off, White Matte, and 0% Web Snap. (These last two aren't important; this is just the default.) Sort the color table by Popularity, as in the picture further right, and save the setting as something descriptive (I use "PNG 17 Adaptive Dithered.")


The optimized png will then appear. Don't be alarmed if the predicted size shown on the lower left seems a bit high. Photoshop (and Imageready) do not use a very optimized routine for compressing and saving their pngs. Later I'll talk about how to use pngcrush to fully the pngs.

You often will not need to keep all of the colors in the color table. I've found that usually the picture will do just fine without colors with values higher than 248 or lower than 18. A common color that will be recommended is 251—in this picture, it recommends 252. Since the table is sorted by popularity, this indicates that 252 is the least-used color of all 17 indexed colors. If you've followed cleanup steps correctly, the image's whites should be white (255) and blacks should be black (0), so there's generally no need for a color that's close to extremities. Click on that color and drag it to the trash. Your final image may thus be a 16 or 15 or even 14-color image instead of 17. When you trash a color the palette menu will switch itself to "Custom" instead of "Adaptive."
Save the file. This picture is 189.6K, which is larger than the 172K of the jpg and larger than the 152K I mentioned before. That's because Photoshop doesn't save the PNG data into the PNG file in a manner that's very efficient. (Unlike GIF which only has one option—interlaced or not—the compression routine in PNG has a few different parameters which when applied differently can compress files in different ways. Which method is best for your image depends on several different factors.)

The way to make up for Photoshop's png shortcomings is to use a program called pngcrush. pngcrush is an open-source command-line application that reads in a png and tries out up to 140 different compression schemes on it (though less than 10 is the default) to see which results in the smallest file.

As an aside—why 17 colors? Isn't it sort of a random number? Well, if you take a photoshop page with text on it and flatten the image and look at the histogram (or Levels), you'll see 15 spikes, plus the spikes at 0 and 255. That makes 17, so it was a good number to start out with. So far it has appeared to work quite well.

Also, is 3 MB that practical? I've found that manga that doesn't have a lot of tone use can easily fit around 3 MB for a chapter. Manga that uses a lot of tones such as Hikaru no Go will not see as much of a benefit in filesize but the quality is still there and there is some improvement in filesize. Chapter 87, for example, went down by 200K for the zip (it's a long chapter which includes a couple pages that I left as jpg, which is why it's still 4 MB).

Install pngcrush

The pngcrush homepage may be found at this link. If you go to the download page you may be confused and download the wrong thing. Since it's an open-source program the source code is available and prominent on the page. The actual program is listed further down the page under pngcrush-executables. As of this writing the most recent PC (DOS) version is 1.5.8 and you will find it at this link. If you are on Mac OS X then you can find the binary for it on the GNU-Darwin page at this download link.

You're probably wondering why I'm saying to use a command-line program on pictures. Yes, it doesn't seem to make that much sense, and it's not incredibly user-friendly. Someone could easily make a graphical front-end for the program, but I haven't seen one around. Still, for a command-line program, it's not hard to use, and the built-in help is fairly well explained. But so you don't have to muck around with it, I'm going to explain how to use it.

Navigate to the folder where your output pngs are (it's easiest to do this once all pages of the chapter have been saved). Make a new folder there called "optimized" or whatever you want to call it. Still in the folder where your pngs are, run pngcrush with this commandline:

pngcrush -dir optimized -rem alla -m 4 *.png

This tells the program to put the output pngs into the "optimized" folder (put here whatever you named your folder). It also tells it to remove extra bits that Photoshop adds to the png (including gamma information that Photoshop will likely write incorrectly, making the png too dark compared to a jpg; after running pngcrush the png won't be too dark any more). And it tells it to use method number 4. pngcrush then does both things
For every greyscale manga image I've seen, method 4 has been the one that results in the smallest file. If you really want to be sure you get the smallest png possible, use "-m 0" and it will try all 10 standard pngcrush methods. This will obviously make the pngcrushing take longer. If you really really want to make sure, instead of using "-m 0" use the "-brute" option. This makes pngcrush go through its 130 or so other methods, using all permutations of the three parameters. The 10 main methods are included in this; method 119 is the same as method 4, for example (if I recall correctly).

Following is a screenshot of the program at work. Because I was only crushing one png I typed its whole name, but *.png would have worked identically.



[Crop] [Gutter] [Bent lines] [Dirt] [Curves] [Resize & Unsharp] [PNG Save]