Image Compression for webcomics

Like many people here, I read some web comics. Drowtales is my favorite, but also.

For a long time I thought about myself in the back of my head: webcomics are drawn in drawings. These are not pictures. There should be a lot of redundancy (fewer colors, flatter color areas, etc.), and therefore they should be easily compressible at fairly high speeds, while maintaining quality without loss. However, it seems that the best tool to compress them is the same old lossy JPEG.

How so? Do not come up with? I am not an expert in data compression, so my own meager attempts to find the best algorithm were fruitless. The best I could find was Pngcrush , but it still lags behind JPEG in terms of compression.

I would like to hear an expert opinion on this matter. Is this idea my silly and doomed to failure? Or maybe something that people found or that I could drop by?

This, of course, comes from a selfish desire to reduce load times. :)

Added: Some people seem to miss the point, so I’ll clarify:

Webcomic images should have a lot of redundancy, so they should be easily compressible. It is impossible to somehow compress them so that they are both lossless and smaller than JPEG? Or at least compress them better than JPEG, while maintaining quality.

Since they will be for the web , a specialized compressor should probably emit PNG or JPEG - it is simply compressed by a modified algorithm to achieve better results.

+3
source share
15 answers

, . , , Photoshop, , , . , , , , , ..

- , , , , , , , , , JPEG.

+6

, . , , JPEG, , , - .

PNG vs JPEG

lbrandy.com

+14

, SVG. ( , , ..), .

+5

. -. PNG. PNG 167 JPEG 199 JPEG. Break-even - -quality 60 -quality 65, JPEG. , JPEG.

+4

, -

  • jpegtran -optimise JPEG - .
  • PNG pngnq ( 8 ), optipng -i0 ( ). , , , pngnq - , .
+2

JPEG , PNG.

, , , PNG .

Java:

public static void main(String[] args)
{
    BufferedImage img = new BufferedImage(
            256,
            256,
            BufferedImage.TYPE_INT_RGB
    );

    Graphics g = img.getGraphics();

    g.setColor(Color.white);
    g.fillRect(0, 0, 256, 256);
    g.setColor(Color.black);
    g.drawLine(0, 0, 255, 255);
    g.drawLine(255, 0, 0, 255);

    try
    {
        ImageIO.write(img, "jpg", new File("output.jpg"));
        ImageIO.write(img, "png", new File("output.png"));
    }
    catch (IOException e) {} // Don't usually ignore exceptions!

    g.dispose();
}

256 256 "X".

256 x 256 , 8, JPEG 2D DCT 8 x 8 . 8 x 8 , .

( 256 x 256 - 100 x 100 , JPEG , 64 x 64, , , .)

JPEG PNG . (Java ImageIO library 0.75f JPEG.)

:

output.png : 1,308 bytes
output.jpg : 3,049 bytes

, JPEG , , . , PNG , .

, PNG JPEG, - , JPEG PNG, PNG . , , , PNG JPEG .

+2

, . 256 , . , .

+1

, ; LZW- TIFF JPEG, , , , TIFF RLE- . , PNG , RLE , -.

edit: ; TIFF PNG 2: 1 (43K 83K, ImageMagick convert, TIFF → PNG → TIFF , , ImageMagick , , TIFF), , TIFF 8 / ( ), PNG 24 / (RGB).

edit 2: , pngcrush -c 0, . PNGcrush RGB 67K, - 34K. !

edit 3: : , , , -overfloids pontificating. , .

+1

GIF .

JPEG- .

0

, , , .

, , jpeg , , - , , , , , , .

0

, - ... . , - , -, . , , , , .

, JPEG, GIF, PNG .., , ? , , , , , 1) , , (, ) 2) , .


, .

, - - , , . - .

, , , , . .

0

, , , .

0

-, , -, , - .

, Photoshop Painter ( Tablet), - . , , , , , .

. , 20 ? , -. PNG, . - , JPG.

0

OPTIPNG ( ), ADVDEF -4 -z
http://advancemame.sourceforge.net/comp-readme.html ( , Advpng ) .

pngout http://www.advsys.net/ken/utils.htm Irfanview. Kzip, , 7-zip, .

EDIT:
okcancel20031003.gif "" ? 256 147KB
PNG () 126KB
PNG (Irfanview) 120

PNG (Irfanview) +
Optipng -o5 120KB ( 525 ) 9s
Optipng + ADVDEF 114 KB 9s + 0.9s
PngOut 114 KB 6s

BMP 273

BMP +
7z (LZMA-fb 273) 107 KB
RAR () 116 KB
BMF -S 90 KB 0.3s
Paq8o10t -4 79 KB 35s

0

, . , , - , / , -. , , - PNG, JPG GIF, PNG, JPG GIF, .

.

  • JPEG
  • jpeg - 24/32 PNG

-.

An alternative would be to get major browser providers to support uber-comic-image nativity. I will leave the reasons why the exercise does not work for the viewer.

-one
source

All Articles