Adobe
Products

Top destinations

  • Adobe Creative Cloud
  • Creative Suite
  • Adobe Marketing Cloud
  • Acrobat
  • Photoshop
  • SiteCatalyst
  • Students
  • Elements family

Adobe Creative Cloud

  • What is Adobe Creative Cloud?
  • Design
  • Web
  • Photography
  • Video
  • Students
  • Teams
  • Enterprise
  • Educational institutions

Design and photography

  • Photoshop
  • Illustrator
  • InDesign
  • Adobe Muse
  • Lightroom

Video

  • Adobe Premiere
  • After Effects

Web development and HTML5

  • Edge Tools & Services [opens in a new window]
  • Dreamweaver
  • Gaming [opens in a new window]

Adobe Marketing Cloud

  • What is Adobe Marketing Cloud?
  • Digital analytics
  • Social marketing
  • Web experience management
  • Testing and targeting
  • Media optimization

Analytics

  • SiteCatalyst
  • Adobe Discover
  • Insight

Social

  • Adobe Social

Experience Manager

  • CQ
  • Scene7

Target

  • Test&Target
  • Recommendations
  • Search&Promote

Media Optimizer

  • AdLens
  • AudienceManager
  • AudienceResearch

Document services

  • Acrobat
  • EchoSign [opens in a new window]
  • FormsCentral [opens in a new window]
  • SendNow [opens in a new window]
  • Acrobat.com [opens in a new window]

Publishing

  • Digital Publishing Suite

  • See all products
Business solutions

By business need

  • Digital analytics
  • Digital publishing
  • Document management
  • Media optimization
  • Social marketing
  • Testing and targeting
  • Video editing and serving
  • Web development [opens in a new window]
  • Web experience management
  • See all business needs

By industry

  • Broadcast
  • Education
  • Financial services
  • Government
  • Publishing
  • Retail
  • See all industries
Support & Learning

I need help

  • Products
  • Adobe Creative Cloud
  • Adobe Marketing Cloud
  • Forums [opens in a new window]

I want to learn

  • Training and tutorials
  • Certification [opens in a new window]
  • Adobe Developer Connection
  • Adobe Design Center
  • Adobe TV [opens in a new window]
  • Adobe Marketing Center
  • Adobe Labs [opens in a new window]
Download
  • Product trials
  • Adobe Flash Player
  • Adobe Reader
  • Adobe AIR
  • See all downloads
Company
  • Careers at Adobe
  • Investor Relations
  • Newsroom
  • Privacy
  • Corporate Social Responsibility
  • Customer Showcase
  • Contact us
  • More company info
Buy
  • For personal and professional use
  • For students, educators, and staff
  • For small and medium businesses
  • Volume Licensing
  • Special offers
  • Adobe Marketing Cloud sales [opens in a new window]
Search
 
Info Sign in
Why sign in? Sign in to manage your account and access trial downloads, product extensions, community areas, and more.
Welcome,
My Adobe
My orders
My information
My preferences
My products and services
Sign out
My cart
Privacy My Adobe
Adobe
Products Sections Buy   Search  
Solutions Company
Help Learning
Sign in Sign out Privacy My Adobe
Preorder Estimated Availability Date. Your credit card will not be charged until the product is shipped. Estimated availability date is subject to change. Preorder Estimated Availability Date. Your credit card will not be charged until the product is ready to download. Estimated availability date is subject to change.
Qty:
Purchase requires verification of academic eligibility
Subtotal
Promotions
Estimated shipping
Tax
Calculated at checkout
Total
Review and Checkout
Adobe Developer Connection / HTML5, CSS3, and JavaScript /

Introducing CSS FilterLab

by Razvan Caliman

Razvan Caliman
  • html.adobe.com
  • Web Platform Blog
  • Adobe and the web
  • @razvancaliman
  • @AdobeWebPlatfrm

Content

  • CSS FilterLab
  • Getting started
  • Animating effects
  • Code syntax
  • Creating new custom filters
  • Sharing and importing custom filters
  • Open source
  • Where to go from here

Modified

22 October 2012

Page tools

Share on Facebook
Share on Twitter
Share on LinkedIn
Bookmark
Print
animationCSSHTML5
Was this helpful?
Yes   No

By clicking Submit, you accept the Adobe Terms of Use.

 
Thanks for your feedback.

In October 2011, Adobe proposed CSS Shaders as a way to bring cinematic effects to the web. Effects like saturation, gamma, burn, fold, curl, and even dissolve and explode could be applied with CSS to regular HTML elements. That proposal has evolved. It has been openly debated, updated, and merged with the CSS Filter Effects specification. It is now on its way to a browser near you. CSS Shaders now go by the name of CSS Custom Filters but they're just as expressive.

CSS FilterLab

CSS FilterLab is a browser-based tool that lets you play with CSS filters, tweak them, and see the effects in real time (see Figure 1). You can use the tool to combine multiple filters and animate them to create rich cinematic effects.

Figure 1. Creating and applying filters in CSS FilterLab.
Figure 1. Creating and applying filters in CSS FilterLab.

At the time of writing, this is really cutting-edge technology, so only a few browsers support it. So, when you open up CSS FilterLab in your browser, you'll be prompted with instructions on what to do to get the best experience. We took great care to make those instructions simple and easy to follow.

Getting started

It's easy to start experimenting with CSS FilterLab. Once you open it up in a browser, you can start adding filters from the Add Filter menu.

You can choose to apply built-in filters or custom filters:

  • Built-in filters are the ones that come by default with the browser. They bring basic color effects such as grayscale, sepia, saturation or contrast.
  • Custom filters take effects to a whole new level. Some examples that have been built include effects like burn, curl, fold, dissolve, explode, and many more. Custom filters don't come with the browsers; they're written by developers themselves. They make use of shaders, which are small programs that enable fine-grained control over color and geometry. Shaders take advantage of hardware acceleration and are commonly used in visual effects for gaming. They might look alien to CSS developers, and they generally require a strong grasp of math.

Fortunately, CSS FilterLab comes bundled with a few great examples of custom filters with underlying shaders. One such example is Fold, which gives an HTML element the 3D aspect of a folded piece of paper (see Figure 2).

Figure 2. The Fold custom filter applied to the HTML element in CSS FilterLab.
Figure 2. The Fold custom filter applied to the HTML element in CSS FilterLab.

The filters that have been applied expose their parameter controls. This makes it very easy for you to fine-tune them to get the effect you're looking for. In addition, multiple built-in and/or custom filters can be applied together to get stunning results.

Once you're happy with the result, save your changes as a preset. This allows you to reuse the configuration later.

Animating effects

Effects don't just happen. They come into being, transitioning from one state to another. This is what makes them expressive.

CSS FilterLab comes with a basic set of animation controls that help you create smooth transitions between filter parameter values.

Notice the timeline and controls at the bottom of the screen. Click at any point of the timeline, and then change the parameters of the active filters. This creates a new keyframe on the timeline. Hit the play button to see the animation run through (see Figure 3).

Keyframes can be added, dragged around the length of the timeline or removed so you can tweak the animation to get it just right.

The duration of the animation can be changed from the input to the right of the timeline. It's measured in seconds.

Quick walkthrough of creating a fold animation with CSS FilterLab. (0:19)

Code syntax

CSS FilterLab enables you to create rich visual effects. It's important to know that this is done with plain CSS, albeit cutting-edge CSS.

At Adobe, we've worked hard, together with our partners, to bring this technology to the open web. We're not about to hide it behind a tool.

CSS FilterLab shows the exact code that's being used to achieve an effect or animation. The CSS Syntax and CSS Animation Syntax panels, just above the timeline, show just what you'd expect. You can copy this code into your own projects to make use of the effects. Keep in mind that CSS Filters are just starting to become available in browsers.

Creating new custom filters

This is where things can become challenging. However, if you find complex math and writing shaders particularly appealing, you'll be glad to know that CSS FilterLab includes a fully-fledged shader editor (see Figure 4).

To create a new custom filter, start by forking an existing custom filter from the ones provided under the Add Filter menu. You'll notice that your forked filter appears in the Forked tab of the menu. Click the "customize" icon and you'll get to the core of a custom filter.

From this point on, you have full control over the parameters used, their types, as well as the fragment and vertex shader source. Your changes are automatically saved and stored locally, in the browser.

Shaders are written in OpenGL Shading Language (GLSL). The topic of writing shaders is beyond the scope of this introduction, but you can learn more from the GLSL documentation. Be sure to read about the types, methods, and features of the language to get the best out of your shaders.

Figure 3. The error panel highlights issues.
Figure 3. The error panel highlights issues.

The error panel highlights any issues with your shader code, in real time. This is really useful because it keeps you in the same context while developing and previewing. You also get to see the results of your shader code in real time.

Sharing and importing custom filters

Share your custom filters by publishing them from CSS FilterLab as a gists on GitHub. The controls for doing this are found in the shader editor panel.

Once published, share the link with others. They'll be able to import your custom filter in CSS FilterLab and use it on their own content. To import a custom filter go to the Add Filter menu, choose Import and use the gist URL.

Open source

All of the code for CSS FilterLab is freely available on GitHub under the Apache License v2. We're looking forward to your thoughts, feedback, and contributions to the project.

If you write shaders that you'd like to distribute with CSS FilterLab, please contribute them to the project. Before checking in any code, take a moment to make yourself familiar with the contribution guidelines outlined on GitHub.

Where to go from here

CSS Filters and Custom Filters open up a wealth of creative effects for web content. CSS FilterLab gives only a hint about what's becoming possible. But the true value is in your hands and in what you create with this technology.

Give some thought to the new opportunities for interaction and expressiveness that filters, geometry manipulation and cinematic effects can bring to your work. Think about what this means for your content on a large screen, on a mobile device, and in so many new contexts.

Use CSS FilterLab to learn about the capabilities of the modern graphical web and share your thoughts with us. We'd love to know what you create with them.

Adobe's Alan Greenblatt has created a short video walkthrough of CSS FilterLab. If you're keen to learn more, that is a great place to start.

You can also find out more about Adobe's contributions to make the web even better by visiting html.adobe.com.

Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License+Adobe Commercial Rights

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. Permissions beyond the scope of this license, pertaining to the examples of code included within this work are available at Adobe.

More Like This

  • Using CSS3 transitions: A comprehensive guide
  • The pursuit of simplicity
  • Backbone.js Wine Cellar tutorial – Part 1: Getting started
  • JavaScript design patterns – Part 1: Singleton, composite, and façade
  • Getting started with PhoneGap in Eclipse for Android
  • Using the Geolocation API
  • Unit test JavaScript applications with Jasmine
  • Backbone.js Wine Cellar tutorial – Part 2: CRUD
  • Build a Hangman game with HTML5 Canvas, JavaScript, and CSS – Part 1: Creating the interface
  • Introduction to web typography and @font-face

Products

  • Adobe Creative Cloud
  • Creative Suite
  • Adobe Marketing Cloud
  • Acrobat
  • Photoshop
  • Digital Publishing Suite
  • Elements family
  • SiteCatalyst
  • For education

Download

  • Product trials
  • Adobe Reader
  • Adobe Flash Player
  • Adobe AIR

Support & Learning

  • Product help
  • Forums

Buy

  • For personal and professional use
  • For students, educators, and staff
  • For small and medium businesses
  • Volume Licensing
  • Special offers

Company

  • News room
  • Partner programs
  • Corporate social responsibility
  • Career opportunities
  • Investor Relations
  • Events
  • Legal
  • Security
  • Contact Adobe
Choose your region United States (Change)
Choose your region Close

North America

Europe, Middle East and Africa

Asia Pacific

  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States

South America

  • Brasil
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Česká republika
  • Danmark
  • Eastern Europe - English
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • 台灣

Southeast Asia

  • Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam - English

Copyright © 2013 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy | Cookies

Ad Choices

Reviewed by TRUSTe: site privacy statement