473,586 Members | 2,792 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How turn cmyk jpeg into rgb using Java?

How can I load a CMYK jpeg image (originally saved from Photoshop) and then
turn it into an rgb BufferedImage, in order to display it on screen in an
applet?

I first tried ImageIO.read(), but that does not work for cmyk jpegs. I then
looked into the com.sun.image.c odec.jpeg package, and tried methods like
decodeAsBuffere dImage() and decodeAsRaster( ).

The first one (decodeAsBuffer edImage) returned an image, but it seems that
it was interpreted as an ARGB, and the colors were incorrect.

I then read the documentation which (amongst many other things) stated that
"If the user needs better control over conversion, the user must request the
data as a Raster and handle the conversion of the image data themselves."
This made sense, so I took to decodeAsRaster( ), only to find that I could
not figure out how to carry out the desired conversion.

Of course, I have looked into the documentation for BufferedImage, Raster,
ColorModel, ColorSpace etc, but after a while I was lost. (Before I got lost
I read that you can convert images with the help of methods like toRGB,
toCIEXYZ.)

I have a feeling that this is probably pretty simple if you just know how to
do it, but I sure would need some directions here.

Any help would be appreciated. Thanks.

Mats Olsson
Jul 17 '05 #1
0 5553

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
5158
by: webstar | last post by:
How do you play wave files using java.applet.Applet?
1
4329
by: ochulus | last post by:
Hi! I'm new to Java and I would like to know how to manage files (e.g. rm, mv, mkdir, etc.) using Java for a simple text-based application on Unix. It's just an extension of a tutorial question at uni where we have to store bank customer details to a file. Thank you! pras
1
2503
by: Utada P.W. SIU | last post by:
Hi all professional I would like to know how to using java class file inside ASP page I have placed the class file to C:\WINNT\java\trustlib also, I have compiled it to 1.1 version but it always prompt error '800401e5' No object for moniker
2
4950
by: tvmaly | last post by:
I have been trying to add a watermark to a jpeg using PIL, but the watermark has a black box around it. I looked at http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/362879 and http://mail.python.org/pipermail/python-list/1999-May/003369.html but I think these only refer to gif or png. I know jpegs really do not
2
9216
by: Kent Lewandowski | last post by:
hi all, Recently I wrote some stored procedures using java jdbc code (admittedly my first stab) and then tried to implement the same within java packages (for code reuse). I encountered problems doing this. I wanted to implemented a generic "Helper" class like this: /** * Helper
0
1184
by: Klaus Jensen | last post by:
Hi! I need to convert EPS to JPEG using VB.Net. I have tried componentsource.com, but I can only find a component from leadtools to do the job, and their components are a bit pricey. Are there any alternatives? Thanks in advance
3
12285
by: tathagata | last post by:
Someone please tell me how I convert swf to jpg/jpeg using php. If anyone send me the code it will be very helpful forme.I waiting for this answer.
6
21839
by: rakeshvthu | last post by:
hi all, i am using struts for my presentation and i use html:text for my text boxes the issue is i want to disable autocomplete option for that i tried in so many different ways but it has not worked.. can any one give suggestion by writing javascript for that it is very urgent.............
1
3919
by: Shun | last post by:
Hello, I am trying to extract the data from my Oracle 10g database using Java. First, I tried to connect Oracle to Java using this code and it works. import java.util.*; import java.sql.*; import java.io.*; public class TestDBOracle {
0
8199
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7950
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8212
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6606
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5710
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3835
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3863
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2343
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1447
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.