color shifting and loss of transparency

moshe weitzman - April 7, 2008 - 02:32
Project:CSS Sprite Generator
Version:5.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

i plan to use this module on groups.drupal.org and then drupal.org since our bluebeach theme has quite a few css background images.

when i compare the sprite image versus the original using the handy admin page of this module, i sometimes see color shifting, usually toward grey. this seems more prevalent for png and jpg than gif. below are two original images whose sprites do not look right. we are using php 5.2.5 and GD 2.0.34.

i am definately interested in your upcoming feature: "Dynamically re-write CSS to implement the sprites.". ideally your code could work on an aggregated stylesheet such as http://groupsbeta.drupal.org/files/css/ce46b4cbd03b7c0c966ec58a4053fd4b.css (if this link breaks, just view source on a groups.drupal.org page and see its css.

ORIGINAL - COLOR SHIFT

SPRITE GIF

ORIGINAL - TRANSPARENCY LOSS PNG

I won't embed my PNG sprite since it is enormous. You wil want a browser background color other than white to see the lack of transparency. Here is the link.

#1

moshe weitzman - April 7, 2008 - 02:43
Category:bug report» feature request

I just noticed the 'Sprites per image:' pref. i set that to 10 and the quality problem went away. I suggest defaulting that to some reasonable number. 0 seems like a bad idea.

#2

tjholowaychuk - April 7, 2008 - 14:09

I think on my local copy it is set to 8 or 10, I tested that a bunch as well and one of the two seemed optimal. I will have to play around with GD some more and see if I can optimize some of the color palettes the png's were rather large for the most part. Unfortunately I am swamped at the moment but I would love to get back to working on this module ASAP.

 
 

Drupal is a registered trademark of Dries Buytaert.