Comments

Comments are locked. No additional comments may be posted.

Steven Garrity -

Clever hack - very nice. Though you should have named it the Burka/Farnher/Frauvenhaupher Image Joint Photographic Experts Group Portable Network Graphics Overlay Enhancement Technique, or "N.A.M.B.L.A."

Jeff -

I believe Photoshop can also use alpha layers to determine JPG quality for specific sections of an image when saving for the web. This would likely get you the "sharp" areas, while giving you high compression on the "graphic" areas. It's worked pretty well for me in the past.

But this is a neat trick. ;)

Jay Jones -

Neat. I've used similar overlays in the past, but for different effects.
You could have achieved a similar effect by just using a <div> container, giving it a positon:relative so other items inside could be absolutely positioned, and then position 4 separate elements inside.

This would allow you to have greater flexibility over the positioning, editing, etc. of the image assets. Sure, it would mean 4 hits on the server, but really... the times that would really cause a problem would be very few and far between.
Anyway... just a thought! :)

Nathan -

Great job. I do agree that this might also be useful as a relative positioned container, but only if it was absolutely necessary for the job.

Daniel Burka -

Jay and Nathan: Sure, this particular example could certainly be done nicely by employing a relatively positioned container with absolutely positioned contents. However, that's awfully heavy-handed code for solving a pretty simple problem (this way is a single image tag and a single css property). There are also lots of times when the separation of the components of a composite image isn't nearly as clear as in the example above, which was intentionally simple to illustrate the point in an easy-to-understand manner. Thanks for the good feedback.

Ken -

Cool alternative to a single image of the wrong type.

Gill -

definitely a great addition for simple image manipulation for websites.

James AkaXakA -

That is an excellent way to go about it!

Bio via LinkedIn

Daniel Burka

My name is Daniel Burka. I'm a web designer living in San Francisco. Currently, I'm the director of design with a startup called Tiny Speck and for several years I was the creative director at Digg. I grew up in PEI, Canada, where I was one of the founders of silverorange. Aside from obsessing about interface design and css selectors, I'm a frequently-falling rock climber, a lazy cyclist, and an often out-of-bounds disc golfer.

Tweets via Twitter

Photos via Flickr

Listening via Last.fm

Syndication via RSS

Search