Saturday, June 02

Art

It Takes An Image

Well, I've uploaded Minx 1.0, so it's time I started playing with some of the new features. Let's see:

Automatic Server-Side Image Scaling and Thumbnails (ASSIST!)

Shrink to 200 pixels wide - side-by-side with a browser-scaled image for comparison:
[thumbnail=/images/Benten.jpg size=200x]
http://ai.mee.nu/images/Benten.jpg

Shrink to 200 pixels tall:
[thumbnail=/images/Benten.jpg size=x200]


Fit inside a box 100 pixels square, keeping proportions:
[thumbnail=/images/Benten.jpg size=100x100]



Resize to 100 pixels square, regardless of proportions:
[thumbnail=/images/Benten.jpg resize=100x100]


Accessing this directly from HTML:

<img src="/images/Benten.jpg?size=200x" border="0" />
benten

This is intended to make it easy to produce image galleries and photo albums where you need to produce images in multiple resolutions. Also, it will be used for user avatars: Since mee.nu users have complete control over their site layouts, there won't be a single fixed size for avatars, and resizing in the browser produces ugly images.

The advantages (apart from the improved quality) are that it makes it very easy to keep the image proportions, and it produces smaller files for fast loading times. (And less strain on your bandwidth.) Doing high-quality image processing is fairly CPU intensive, but we already have 16 CPUs at our disposal, so that is not anticipated to be a problem.

One hitch: This doesn't work for animated GIFs. Neither does the image processing function in the file module; the GIF library I'm using is lacking in several respects.

Posted by: Pixy Misa at 11:07 PM | Comments (6) | Add Comment | Trackbacks (Suck)
Post contains 220 words, total size 3 kb.

1 I hope that image resizing isn't being done on the fly every time a page is loaded; that sounds like a real glutton for CPU cycles. But given that it's a tag, I suspect that's the case.

Posted by: Steven Den Beste at Sunday, June 03 2007 08:32 AM (+rSRq)

2 It's cached (both on the browser and the server).

Posted by: Pixy Misa at Sunday, June 03 2007 12:26 PM (PiXy!)

3 Only I broke the caching.

Posted by: Pixy Misa at Sunday, June 03 2007 01:40 PM (PiXy!)

4 Caching now fixed.

Posted by: Pixy Misa at Sunday, June 03 2007 01:58 PM (PiXy!)

5 The other reason I'm not particularly worried about CPU load is that our standard cluster node is now a quad-core Xeon.  We're not short of CPU power.

And that only costs us 10% more than the dual-core Opterons we originally budgeted for, while delivering 2.5x the performance.

Also, the image engine automatically switches to a less CPU intensive algorithm for large target sizes.  Still higher-quality than browser scaling, of course.

Posted by: Pixy Misa at Sunday, June 03 2007 02:41 PM (PiXy!)

6 The comparison with the browser is rather impressive.

Posted by: Pete Zaitcev at Tuesday, June 05 2007 10:19 AM (9imyF)

Hide Comments | Add Comment

Comments are disabled. Post is locked.
37kb generated in CPU 0.0174, elapsed 0.493 seconds.
56 queries taking 0.4806 seconds, 158 records returned.
Powered by Minx 1.1.6c-pink.