Skip navigation.

Log in | Sign up

Linux for Designers

a blog by Eckhard M. Jäger

CSSdev for Gimp

, , , , , ,

So here comes my announced and awaited script "CSSdev for Gimp" that is a remastered and more feature rich Python implementation of the old and buggy Gimp2CSS. After a hacking session at area42 this is a first cool working version was available. Meanwhile i updated this script various times and added more features. The major goals for the future are adding support for floating design and nested layers.

How it work:
* open your designed draft in Gimp
* Goto "Filter > Web > CSSdev"
* select your options and a folder where to export the "gimp_cssdev.html"
* After export you will find an XHTML source in the given directory that includes CSS styles too

What still works:
* Visibility for layers and the options of the CSSdev dialog
* Opacity for layers
* Creating an z-indexed based layout
* Layer positions and layer size
* Default font and alternative faces based on my CSS font matching
* default font, its size and its style
* Link colors
* Background color and forground color are based on the actual background colors and forground color of the toolbox
* optional export of layer height
* optional automatic color picking for DIV background color
* The CSS property Clip is supported via layer masks
* Creating additional CSS code for text layers (requires Gimp 2.5.x +)
* Export content of text layers (requires Gimp 2.5.x +)
* Croping layers to their content on export

All other options did not work at this moment but will coming soon.
Download
Download the CSSdev script and copy it to
/home/#YourProfileName/.gimp-2.6/plug-ins
Make sure the file is marked as executable.

Windows user have to copy it to
C:\Dokumente und Einstellungen\#YourProfileName\.gimp-2.6\plug-ins
Make sure your Gimp-Python is installed and working, Windows users will find more informations about Python and Gimp here. The cssdev.py must be marked at the accessrights as an excutable.

^Firefox download day

Comments

Anonymous 22. June 2009, 17:08

ziyaretçi writes:

I wonder if there will be an update and new features for this usefull plug-in. Besides a guide for users...

Anonymous 24. June 2009, 18:02

Anonymous writes:

This is a great plugin, but I have been getting a weird error:
Traceback (most recent call last):
File "/tmp/skl/Gimp.app/Contents/Resources/lib/gimp/2.0/python/gimpfu.py", line 685, in response
dialog.res = run_script(params)
File "/tmp/skl/Gimp.app/Contents/Resources/lib/gimp/2.0/python/gimpfu.py", line 352, in run_script
return apply(function, params)
File "/tmp/skl/Gimp.app/Contents/Resources/lib/gimp/2.0/plug-ins/cssdev", line 231, in python_cssdev
layer_bg = active_image.layers[this_layer].get_pixel(xpos,ypos)
error: could not get pixel (30, 30) on drawable (ID 2)

And this dialog comes up as well:
error: could not get pixel (30, 30) on drawable (ID 2)

como lo solucions

Anonymous 24. June 2009, 18:03

Anonymous writes:

This is a great plugin, but I have been getting a weird error:
Traceback (most recent call last):
File "/tmp/skl/Gimp.app/Contents/Resources/lib/gimp/2.0/python/gimpfu.py", line 685, in response
dialog.res = run_script(params)
File "/tmp/skl/Gimp.app/Contents/Resources/lib/gimp/2.0/python/gimpfu.py", line 352, in run_script
return apply(function, params)
File "/tmp/skl/Gimp.app/Contents/Resources/lib/gimp/2.0/plug-ins/cssdev", line 231, in python_cssdev
layer_bg = active_image.layers[this_layer].get_pixel(xpos,ypos)
error: could not get pixel (30, 30) on drawable (ID 2)

And this dialog comes up as well:
error: could not get pixel (30, 30) on drawable (ID 2)

como lo soluciono

Anonymous 25. June 2009, 08:34

Anonymous writes:

Hello,

been having the same problem with the "error: could not get pixel (30, 30) on drawable (ID ...)" thing, and after some poking around the code I found out that maybe the plug-in has problems with layers, where there is no 30, 30 pixel - if the layer is less than 30px high or wide. So I changed the variables xpos and ypos (on lines 54 and 55) from '30' to '1', and the plug-in never showed me that error again and worked with no problems at all. Hope that I've been some help :)

Eckhard M. Jäger 25. June 2009, 12:55

this is one small bug, it happens if there is no pixel at position 30,30

Anonymous 25. June 2009, 15:57

Anonymous writes:

By the way, do someone has any idea why the "Generate images" option is missing? I don't recognize code for it in the plug-in as well...

Anonymous 9. July 2009, 11:39

Anonymous writes:

I'm getting the could not get pixel (30, 30) error, too even with libgimp-perl installed. I'm on Ubuntu Jaunty with Gimp 2.6

Anonymous 16. July 2009, 20:22

Anónimo / Martin writes:

CSSDEV funciona bien bajo Linux ubuntu ;) hace un hermoso html con css prolijo.
Lo que no pude hacer -por ahora- es que exporte tambien las imagenes.
:(
Saludos
martin

Anonymous 16. July 2009, 20:23

Anónimo / Martin writes:

CSSDEV funciona bien bajo Linux ubuntu ;) hace un hermoso html con css prolijo.
Lo que no pude hacer -por ahora- es que exporte tambien las imagenes.
:(
Saludos
martin

Anonymous 16. July 2009, 20:25

Anónimo / Martin writes:

CSSDEV funciona bien bajo Linux ubuntu ;) hace un hermoso html con css prolijo.
Lo que no pude hacer -por ahora- es que exporte tambien las imagenes.
:(
Saludos
martin

DG Martin Diaz Cortez 17. July 2009, 00:19

El plugin CSSDev anda bien con GIMP en Linux Ubuntu.
Me ha permitido exportar archivos html con etiquetas div, con texto y css.
Lo que todavia no he podido lograr es que la exportación recorte y guarde las imagenes.
La diferencia está en que el plugin que yo me descargué no es como el de la imagen de ejemplo, ya que no tiene las opciones "Generate Images" ni "Image Format", sigo buscando la version del plugin completa.

Saludos
Martin Diaz Cortez

DG Martin Diaz Cortez 17. July 2009, 13:36

Solo falta agregar la imagen de fondo

Dos excelentes Plugins de Gimp
1.
El plugin " CSSDev " resuelve satisfactoriamente la exportacion de capas de un archivo de GIMP en Ubuntu, y exporta un archivo HTML con estilos css, texto y divs.
Lo que le falta es que exporte las imagenes: falta que exporte los png de cada capa y falta que escriba en el css la imagen de fondo de cada estilo, por ejemplo:
.layer01 {
background-image ('imglayer01.png');
}
2.
El Plugin " Script-Fu / PPRacer / Save Image as PNGs " resuelve satisfactoriamente la exportacion de las capas en archivos separados en formato .png , en Gimp, instalado en Ubuntu.

Seria bueno unificar esfuerzos para combinar estos dos plugins, con el objetivo de compilar un plugin que resuelva estas opciones de manera centralizada.

Saludos
Martin Diaz Cortez

Anonymous 28. October 2009, 08:21

Greg M. writes:

Thanks for this great script. Are you planning any updates in the near future?

Anonymous 15. December 2009, 19:31

ivme writes:

I think your plugin is one of the most important plugin and it must be developed. do you think any updates? new features like slicing images in a file?

thanks again ...

How to use Quote function:

  1. Select some text
  2. Click on the Quote link

Write a comment

Comment
(BBcode and HTML is turned off for anonymous user comments.)

If you can't read the words, press the small reload icon.


Smilies