Thursday, November 18, 2010

How to replace colours with transparency with the Gimp

It sometimes happens you have an image which has been made partially transparent to be shown on a red background. You'd like to use this image on a blue background, but that looks very bad. What to do?

Here's how to change all occurences of red, including semi-transparents, half-tones and shades, to blue. You'll keep your bright/dark nuances.

  • Open the image with the Gimp.

  • Set mode to RGB: Image > Mode > RGB

  • Select the part where you want to change the color. Normally, you'd use the select-similar-colors tool. Point it to the offending (red) color.

  • Desaturate the selection: Colors > Desaturate > Luminosity. Your selection will turn grey, all shades of it (assuming your images had shades of the sames color, why else would you be doing this?).

  • Change the grey to alpha: Colors > Color to alpha. At the prompt box, use the color picker and point it to the same place you pointed to when creating the selection.

  • Add a new layer (Windows > Dockable dialogs > layers). Make its background color the target color (blue).

  • Invert the selection (Ctrl-i) and delete it (Del), so the new layer is transparent except on the places where you wanted to change the color.

  • Move this layer below the rest.

  • Save it, you're done.

Wednesday, November 3, 2010

Looking back on Bristol

Likes:

  • Flying KLM instead of some DTA (Duck Tape Airlines)

  • Our apartment in Marsh St. from Alderman Apartments

  • Pub lunches and beer

  • Many many many interesting Plone talks

  • Richard Noble's guest keynote

  • Dinner with the guys from 4D

  • Many many many more interesting Plone talks

  • A run along the river with my colleague Peter

  • Pies, beer, cider and the music from Fellow Stranger

  • The Irish pub and the band

  • Many interesting Open Spaces

  • Sprinting on xdv, excuse me, Diazo documentation

  • The spin-off: putting all these great ideas to work!

IE8 bug causing first list item to be too high

I had an unordered list where the first list item was too high in IE8. At first i thought it was one of the many javascripts, then i thought it was something to do with IE8's rendering of lists, but when i stripped the HTML it turned out it was an anchor link on the top of the page.

It's a known bug (http://webbugtrack.blogspot.com/2008/04/bug-371-named-anchor-links-are-broken.html). The referenced site states no workaround, but not using a self-closing tag seems like a good workaround me, for example:

<a name="top"></a>