Hi,

I've tried the image with jpgicc and it comes fine, so the issue 
comes from somewhere else. I would check the destination profile: 
which one are you using? On jpgicc I've used built-in sRGB and it 
is ok, but I can see diffent colors on skin tones, bride dress, etc.

BTW, converting individual pixels is slow... if you can convert a
big block, or even  scanline at time, you will get a big throughput 
improvement.
Regards
Marti

Original Message:
-----------------
From: Adam Olson olsona...@gmail.com
Date: Wed, 20 Apr 2011 11:02:30 -0500
To: lcms-user@lists.sourceforge.net
Subject: [Lcms-user] Transform problems with LCMS in AS3/Alchemy


Hey list members,

I've been working on porting LCMS to Alchemy so I can convert Adobe RGB to
sRGB. I've got everything working except it's not transforming properly. I
can send it the ICC profile from the .jpg file and it will read it
correctly. I can send data to C and it seems to be in the right order (A, R,
G, B. No endian problems it seems). It seems to read everything properly,
but the final transformed image comes out incorrect. If anyone could let me
know if the transform code I'm using is wrong that would be great!

Here's the original image
http://nothotbutspicy.com/jpghelp/adobeRGB.jpg

Here's the image I get from LCMS
http://nothotbutspicy.com/jpghelp/sRGB%20(without%20profile).jpg

This is the code I'm using to convert (sourceImageStream is a FILE* created
from an Alchemy ByteArray of Flash BitmapData. DestImageStream is the same.
Flash BitmapData is stored as ARGB_8. size_amt is number of bytes in the
sourceImageStream)

cmsHTRANSFORM hTransform = cmsCreateTransform(sourceProfile, TYPE_ARGB_8,
destProfile, TYPE_ARGB_8, INTENT_PERCEPTUAL, 0);

unsigned char *bufferSourceARGB = (unsigned char*)malloc(sizeof(unsigned
char) * argb_pixel_size);

while(bytesRead < size_amt)
{
    bytesRead += fread(bufferSourceARGB, 1, argb_pixel_size,
sourceImageStream);

    cmsDoTransform(hTransform, bufferSourceARGB, bufferSourceARGB, 1);

    bytesWritten += fwrite(bufferSourceARGB, 1, argb_pixel_size,
destImageStream);
}

Thanks for your help!

Adam


--------------------------------------------------------------------
mail2web LIVE – Free email based on Microsoft® Exchange technology -
http://link.mail2web.com/LIVE



------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
Lcms-user mailing list
Lcms-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lcms-user

Reply via email to