top | item 13041735

Show HN: Image Effects with CSS

203 points| bennettfeely | 9 years ago |bennettfeely.com | reply

18 comments

order
[+] MrQuincle|9 years ago|reply
Slightly related question: Does the carbon footprint increase with all this client side rendering?

I would think just rendering something charcoal on the computer of the designer should be enough, rather than repeating it on the machines of thousands of visitors?

[+] onion2k|9 years ago|reply
Yes, and if your website is using CSS effects to change the same image for every user then you're making a mistake. Just render the modified image to a static asset and serve that.

However, if you want to use a pencil effect on an image that you don't have control over (eg a user's image before they upload it, or something from an API-driven service like Unsplash) then the technique still has a lot of value.

[+] snarfy|9 years ago|reply
It's a good question. What about the network transmission? What's the carbon footprint of transmitting a 50k image to thousands of visitors vs a handful of bytes in css? I agree it does push more energy usage to the client, but I'm not sure how total energy usage adds up.

In any event I don't like it because it kills my battery.

[+] andybak|9 years ago|reply
Are these really that CPU intensive? It's a very basic transform. Probably a rounding error in terms of overall rendering energy usage.
[+] mgalka|9 years ago|reply
Awesome resource. I've spent a lot of time looking for CSS image effects and found the info out there to be really lacking. Thanks for putting this together.
[+] TuringNYC|9 years ago|reply
This is impressive and the documentation is nice. But it would be nice to get the 30-second pitch -- is the rationale to push processing onto the client side? When I think of such effects, I would usually imagine them being on the server side, perhaps on a dedicated image processing server.
[+] jonnyscholes|9 years ago|reply
One advantage is designers having more control to art direct content that's managed by the client (eg make all the images higher contrast and sepia). Sure it can be done on the backend - but that's more out of reach for designers than css. Css also has the advantage of being animatable.
[+] jonespen|9 years ago|reply
Client side image editor is the first thing I thought of.
[+] visarga|9 years ago|reply
It's like PhotoShop. I used to play with pictures and obtain those effects 10-15 years ago. But I think we can do many more special effects with HTML5 Canvas.
[+] jaimex2|9 years ago|reply
Its good to see stuff we were doing with java applets and Flash now just are part of our web frameworks. Its a weird process flow but its slowly getting there.
[+] leni536|9 years ago|reply
Nice. I consider this a hack though, I think that SVG filters are more suitable for this task.
[+] thenormal|9 years ago|reply
Will gladly use, but what is the code's license?