Re: [dwm] xicon - dzen-like tool for icons (2)

From: pancake <pancake_AT_youterm.com>
Date: Sun, 1 Jul 2007 16:13:32 +0200

> > Why, o why, inventing yet another image format. What's wrong with X11's
> > (de facto) native pixmap format, XPM (_X_ Pixmap)? There are already a
> > sea of tools to handle it, it's an ASCII format and is simple enough
> > too. X11 even comes with a library for easy usage of the format.

 For different reasons:
  - I was bored
  - I want a one line format
  - I want an ascii-art friendly format
  - I want a simple 1bit format
  - This is a one-night-hack (R)

XPM is fine for static compilations, so, for hardcoding images, but not
for parsing it on the wild.

There's another format called xfig used by sylpheed and (maybe) other
clients. This format is also 1 bit depth and it's 'standard'.

In reality 1 bit images are cool, but maybe would be good to support
palettes or with 4 or 8bpp. So a standard format like XPM would be good
to support.

I think that there'r two XPM formats a binary and a ascii (c-style like)
one, and it works using a palette. So you'll be able to draw in Gimp
instead of Vim :)

BTW vim supports xpm too and represents in ansi the colors of the palette
on the fly. That's cool too.

At the moment it only handles 16x16x1 images, so xpm is not currently
supported. But I would like to cleanup this horrible piece of code and
start thinking on how to make it better and give't support to multiple
colors.

I was thinking in something like:

pal:0030a830b9200a
img:55300abb33191703749169ab9c639d47f

When reading this formatted lines interpret them from stdin, so it could
be possible to rotate paletes instead of changing pixmaps (common oldstyle
demoscene tricks heh)

The resolution or the depth is not reflected here, so we can use the size
of the palette to get the depth and the size of the image to get a fixed
NxN image resolution.

Do you have another idea about how to implement this?

> > /* XPM */
> > static char * roundb_xpm[] = {
> > /* width height ncolors cpp [x_hot y_hot] */
> > "13 13 5 2 7 7",
> > /* colors */
> > " s none m none c none",
> > ". s topShadowColor m white c lightblue",
> > "X s iconColor1 m black c black",
> > "o s bottomShadowColor m black c #646464646464",
> > "O s selectColor m white c red",
> > /* pixels */
> > " ",
> > " . . . ",
> > " . . X X X o o ",
> > " . X X X X X X X o ",
> > " . X X X X X X X o ",
> > " . X X X X O X X X X o ",
> > " . X X X O O O X X X o ",
> > " . X X X X O X X X X o ",
> > " . X X X X X X X o ",
> > " . X X X X X X X o ",
> > " o o X X X o o ",
> > " o o o ",
> > " "
> > };

Regards

  --pancake
Received on Sun Jul 01 2007 - 16:13:38 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 14:45:38 UTC