Creating sprites using png's which are already transparent

Bug #247554 reported by Stuart Colville
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
CSS Sprite Generator
Invalid
Undecided
Unassigned

Bug Description

I'm attempting to create a sprite with png files which already have transparency. The previous version worked fine; but with the background information now it isn't working. I've left the background blank, and it sets it to white.

Am I not doing something properly?

Thanks in advance,
Matt

Revision history for this message
Ed Eliot (ejeliot) wrote :

Can you email or attach an example ZIP so I can investigate.

Revision history for this message
Ed Eliot (ejeliot) wrote :

Closing as I haven't received any further information from the bug reporter and haven't been able to reproduce myself.

Changed in css-sprite-generator:
status: New → Invalid
Revision history for this message
Enrico Stahn (mail-enricostahn) wrote :

I have the same problem on a fresh debian lenny system with imagick installed. I uses sprite-generate 2 and 3, both with the same results.

PHP Version 5.2.6-1+lenny3

imagick module enabled
imagick module version 2.1.1-rc1
imagick classes Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator
ImageMagick version ImageMagick 6.3.7 03/24/09 Q16 http://www.imagemagick.org

Attached you will find the images which have both a transparent background. I tried to figure it out by myself without success. Seems to be a problem of ImageMagick. Otherwise in line 361 the image background is set to white instead of transparent.

$oSprite->newImage($iSpriteWidth, $iSpriteHeight, new ImagickPixel('#ffffff'), $sOutputFormat);
file_put_contents('/tmp/test.png', $oSprite); exit;

Revision history for this message
Ed Eliot (ejeliot) wrote :

I've been unable to reproduce in two environments. Sprite appears to retain transparency. Would you be able to upload an example of the output sprite generated in your case.

Revision history for this message
Enrico Stahn (mail-enricostahn) wrote :

Hi Ed,

I tried the test.zip with http://spritegen.website-performance.org/ and got the result I've described in my last post. Attached you'll find the result image.

Kind Regards
Enrico

Revision history for this message
Enrico Stahn (mail-enricostahn) wrote :

Any new informations about this issue?

Enrico

Revision history for this message
Stuart Colville (muffinresearch) wrote :

Hi Enrico,

I've just tried this your test.zip with the live sprite generator http://spritegen.website-performance.org and I also get the correct result, a .png with transparency *not* with white background you're seeing.

Note: This is with the default settings. If you're changing the settings could you provide us with the details of the settings that are different from the defaults so we can look into this further.

Attached is the transparent png output.

Revision history for this message
Stuart Colville (muffinresearch) wrote :

Waiting for further information

Changed in css-sprite-generator:
status: Invalid → Incomplete
Revision history for this message
Stuart Colville (muffinresearch) wrote :

Unable to reproduce - If you have further info and this bug still exists against the code in v.4.0 please re-open this bug.

Changed in css-sprite-generator:
status: Incomplete → Invalid
Revision history for this message
Cristian Baltatescu (cbaltatescu) wrote :

I get the same thing. PNG's in the zip file are transparent, resulting image is not. I tried both with "use color for transparent background" option checked or not. Also, I never seem to get a black background?

Revision history for this message
Cristian Baltatescu (cbaltatescu) wrote :

I've also downloaded the test.zip from above and run it through the online version and it spits out a NON-transparent/white-bg image. Sorry.

Revision history for this message
Stuart Colville (muffinresearch) wrote :

This is a strange issue as again I'm unable to reproduce with either zip of transparent images.

Can you provide a screenshot of the settings you're using - I've attached an example of the settings I'm using where I'm getting a result complete with transparency.

Revision history for this message
Cristian Baltatescu (cbaltatescu) wrote :

I think I know what's going on here.
I was zipping up 8 bit per channel images, which when opened in Picasa (my default viewer) showed transparency like in Photoshop (those gray squares).
But the images the sprite generator uses are 16 bit per channel, those have a white bg in Picasa, but DO have transparency, when opened in PS for example.
Another thing is I unchecked the use bg color for transparency in some tests. Why would I leave it on? Am i getting something wrong? DO I need a bg color if i use transparent png's and wnat transparent png's as a result?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.