On Wed, 30 Nov 2005 12:17:29 +0000 Simon Wistow <[EMAIL PROTECTED]> babbled:

> I've started noticing a problem with tiffs that have alpha channels - I
> converted the alpha.tif image to alpha.jpg using Imlib2 (both 1.0.6 and
> 1.1.0). Loading the tif up in xv (or Shake or The Gimp) I get the
> correct brightness but if I convert it with Imlib2 (using the really
> basic conversion eaxample in the docs) the resulting image (in this case
> alpha.jpg) is too dark. 
> 
> This is also the case if save out as png or gif so it's not, as far as I 
> can tell, a problem with the jpg output.
> 
> I noticed in save() that there's a prescaling by an alpha factor but no 
> corresponding descaling in raster() (presumably it's in the TIffGetR 
> macros) but unless I'm smoking crack that would result in the imaeg 
> being too bright so basically I'm stumped.
> 
> I did notice that the alpha on each pixel was 146 and that if I 
> multiplied r,g and b by 1.46 then the brightness was almost right. 
> That's nothing more than a fudge factor though - arbitary numbers a go 
> go.
> 
> Any ideas? Am I ignoring something in my conversion code?

the problem is tif's use pre-multiplied alpha (ie rgb is multipled BY the alpha
value when stored) instead of non-premul (as imlib2's internals, png's argb
etc. use). that means imlib2 is missing the "de-multiply" on load code. it has
the multiple on save. it's a bug. :) -- ------------- Codito, ergo sum - "I
code, therefore I am" -------------- The Rasterman (Carsten Haitzler)
[EMAIL PROTECTED] 裸好多 Tokyo, Japan (東京 日本)


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to