Não é mais possível fazer postagens ou usar assinaturas novas da Usenet nos Grupos do Google. O conteúdo histórico continua disponível.
Dismiss

CMYK JPG files show up with wrong colors in Delphi

2 visualizações
Pular para a primeira mensagem não lida

GuyWithDogs

não lida,
16 de mar. de 2007, 02:06:4916/03/2007
para
A user of a program I wrote ran across a problem where he couldn't
display a particular JPG file. Turns out it was a CMYK encoding
(according to IrfanView). I thought I'd gotten the update JpegEx.dcu
units from CodeCentral (thanks, Gabriel Corneanu!) a while ago, but the
dcu files I had looked older. Possibly reset during an update or
reinstall or something.

OK - I grabbed an updated copy from CodeCentral, created a test program
to verify that I could now read the file. I can, but the colors show up
"funny". For example, there's a section that appears brown when opened
with the Windows Picture Viewer. Shows up in my program as a dark wine
red.

Anybody have any suggestions on why that might happen? Alternately, if
this is a known issue, is there another library that I might try that
implements CMYK-reading for JPEG?

Thanks.

Trond Grontoft

não lida,
16 de mar. de 2007, 06:40:4916/03/2007
para
GuyWithDogs wrote in message

> Anybody have any suggestions on why that might happen? Alternately, if
> this is a known issue, is there another library that I might try that
> implements CMYK-reading for JPEG?

You need a color management engine to handle CMYK files properly.
Try Little CMS : http://www.littlecms.com/
It's free and includes source code.


Nils Haeck

não lida,
16 de mar. de 2007, 11:05:3616/03/2007
para
You can convert CMYK to RGB with an easy formula, no need to install the CMS
engine. The CMS engine is only important if the Jpeg defines a non-default
color space, and embeds the accompanying CMS profile. Then again, I don't
think Gabriel Corneanu's version will work with CMS at all.

Nils

"Trond Grontoft" <tr...@tiger-removethis.no> schreef in bericht
news:45fa...@newsgroups.borland.com...

Ma Xiaoguang

não lida,
19 de mar. de 2007, 07:27:3619/03/2007
para
Hello,

> You can convert CMYK to RGB with an easy formula, no need to install the
> CMS engine. The CMS engine is only important if the Jpeg defines a
> non-default color space, and embeds the accompanying CMS profile. Then
> again, I don't think Gabriel Corneanu's version will work with CMS at all.

I agree with Nils, although I don't know about CMS at all. You could find
the conversion code at http://www.efg2.com . I think that there must be an
easier solution about this, that is, save the CMYK JPEG to bitmap and then
save the converted bitmap back to JPEG again with MSPaint, Photoshop, etc. I
think that this is not a good idea for programmer, but it works indeed.

Best regards.

Xiaoguang


Warrick Wilson

não lida,
19 de mar. de 2007, 14:36:2119/03/2007
para
"Ma Xiaoguang" <maxiaogu...@hotmail.com> wrote in message
news:45fe73a8$1...@newsgroups.borland.com...

I'm a tad confused by these responses, I must admit.

I have a routine that now loads the JPEG in question. It looks OK to me when
displayed, unless I open the JPEG in MS Picture Viewer or something and then
I see that the colors don't match. But I don't know that for a given JPEG I
may have this problem, and my program is just supposed to display JPEGs.

So either the routine that I'm using isn't working correctly, at least for
some colors, or - well, I don't know what the "or" part is.

I'm not sure what help conversion code does me, unless it's to write my own
JPEG loader for CMYK files.

Alternately, I'm open to an alternate library for opening JPEGs that include
CMYK support...

Thanks.


Roy M Klever

não lida,
19 de mar. de 2007, 15:02:5119/03/2007
para
Hi Warrick Wilson,

> Alternately, I'm open to an alternate library for opening JPEGs that include
> CMYK support...

You could try using ImageEn at:

http://www.hicomponents.com/nimageen.asp


Very good and can read jpegs with CMYK.


Kind Regards
Roy Magne Klever

Gabriel Corneanu

não lida,
21 de mar. de 2007, 07:06:2421/03/2007
para

Hello,

I am quite busy these days, and do not have too much time to watch the newsgroups...
As others said, I didn't do too much special to support the CMYK. It basically means:
- decode the jpeg in a 32bpp bitmap (Delphi source was faulty using 24bpp)
- run each scan line through a conversion routine

If you look at the interface file and sample application, you see that there is a property "AutoCMYKToRGB" and a function "BitmapCMYKToRGB".
Set this property to false and get the raw CMYK data in a 32bpp bitmap. Then run the bitmap through your own conversion routine.

Hope it helps.
Regards,
Gabriel

0 nova mensagem