Closed Gankra closed 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.
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)?
The biggest we display the cards is 400 pixels wide (height scaled). The biggest we display the wonders is 960 pixels wide (height scaled).
If you could also add a black glow type thing (rounded edges) to each card, that would be sweet.
Surely there's a way to add a 0-blur radial glow to images in Java?
Surely it's better to do it once on the image files than once every time we render the images?
If memory serves, you can add a bit of blur and border using ImageMagick.
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.
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.
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.
Can you quantify the difference? It may not be very large.
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.
I'll do some quick tests on the images we are using.
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.
Shrunk down to suggested dimensions: 260kB vs 46kB
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.
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.
Drop shadow is likely also a valid search term.
Images now total a mere 7MB.
Bonus: the images look WAY better because there's less of the terrible Java PNG scaling algorithm being applied.
Commit them! 7MB should be fine to put in the repo forever.
Obviously way too huge to commit at this point. Shrink 'em down, maybe re-rexport as JPEG (as they properly should be).