SteamedPears / 3004-SevenWonders

Seven Wonders project for 3004
1 stars 1 forks source link

Images should be scaled down and committed #90

Closed Gankra closed 11 years ago

Gankra commented 11 years ago

Obviously way too huge to commit at this point. Shrink 'em down, maybe re-rexport as JPEG (as they properly should be).

spratt commented 11 years ago

Best way to do this is to write an imagemagick script. I can do it, but I'd really like to get through helping @cdelahousse with creating class diagrams, and finishing up a first draft of the view tonight.

Gankra commented 11 years ago

I might be able to whip up the script. imagemagick is pretty easy from what I remember. Do you have prefered dimensions/scale/quality(MB)?

spratt commented 11 years ago

The biggest we display the cards is 400 pixels wide (height scaled). The biggest we display the wonders is 960 pixels wide (height scaled).

spratt commented 11 years ago

If you could also add a black glow type thing (rounded edges) to each card, that would be sweet.

Gankra commented 11 years ago

Surely there's a way to add a 0-blur radial glow to images in Java?

spratt commented 11 years ago

Surely it's better to do it once on the image files than once every time we render the images?

cdelahousse commented 11 years ago

If memory serves, you can add a bit of blur and border using ImageMagick.

Gankra commented 11 years ago

If we do it on the images, we'd need to stick with PNG, which is wrong as far as I'm concerned. We'd also lose the ability to show them without the blur or modify it easily, if that's a thing we want.

spratt commented 11 years ago

On 2013-03-11 12:18 AM, Alexis Beingessner wrote:

If we do it on the images, we'd need to stick with PNG, which is wrong as far as I'm concerned. Why is PNG wrong? We'd also lose the ability to show them without the blur or modify it easily, if that's a thing we want. I don't think that's a thing we want.

Gankra commented 11 years ago

Because they're scanned images with lots of colours and few solid patches. Basically a painting, which is the sort of thing JPEG is optimized for, and PNG is terrible at.

spratt commented 11 years ago

Can you quantify the difference? It may not be very large.

Gankra commented 11 years ago

This is a really old article on the matter: http://www.ou.edu/class/digitalmedia/articles/CompressionMethods_Gif_Jpeg_PNG.html

But basically PNG does LZW style analysis on the image to id patterns, while JPEG will add random noise to all the pixels effectively destroying any patterns that might have been there. Basically JPEG->PNG will likely always compress horribly, regardless of what the original image was.

Gankra commented 11 years ago

I'll do some quick tests on the images we are using.

Gankra commented 11 years ago

Academy_3_7 Academy_3_7

Exported to JPEG at 90% quality. Went from 1.8MB to 340kB.

Notice no appreciable quality drop. And I haven't even scaled them down.

Gankra commented 11 years ago

Academy_3_7-small Academy_3_7-small Shrunk down to suggested dimensions: 260kB vs 46kB

Gankra commented 11 years ago

Basically, going to JPEG gives us an over 5x better compression ratio, with absolutely no quality penalty. I could probably even crank up the compression without much noticeable effect.

spratt commented 11 years ago

Alright, JPEG seems to be clearly the better option. I'll see if I can figure out how to give images a 0-blur radial glow in Java. At worst, they can keep their sharp corners.

Gankra commented 11 years ago

Drop shadow is likely also a valid search term.

Gankra commented 11 years ago

Images now total a mere 7MB.

Gankra commented 11 years ago

Bonus: the images look WAY better because there's less of the terrible Java PNG scaling algorithm being applied.

spratt commented 11 years ago

Commit them! 7MB should be fine to put in the repo forever.