Links
- Inspired by http://blog.the816.com/post/94021973701/make-generative-collages-for-fun-and-profit
- Code : https://gist.github.com/riebschlager/92d135235d0432a617b1
- Create 24-bit trasparent images with gimp http://pablohoffman.com/internet-explorer-png-transparent-images-with
The steps
- Open the original image (whether it is a 24-bit PNG, a SVG, or whatever)
- Select a proper background color (see the introduction above for details) and create a new layer with that background color (Layer - New layer - Layer fill type: background color). Then exchange the layer order and keep the background layer below (Dialog - Layers - select background layer - hit the Down arrow)
- Flatten the image (Image - Flatten image)
- Add an alpha channel (Layer - Transparency - Add alpha channel)
- Select the background color (using Selection - By color) and clear it (Edit - Clear)
- Convert the image to indexed color (Image - Mode - Indexed color, default settings should be fine). You may notice a background color halo around your image. That's fine, cause it will create an anti-aliased effect once you use put the PNG on your page and it's much better (believe me) than having ugly harsh edges.
- Save the image to the final PNG file (File - Save as) and remember to check: Save color values from transparent pixels