473,387 Members | 1,578 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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.codec.jpeg package, and tried methods like
decodeAsBufferedImage() and decodeAsRaster().

The first one (decodeAsBufferedImage) 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 5535

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

Similar topics

2
by: webstar | last post by:
How do you play wave files using java.applet.Applet?
1
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...
1
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...
2
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 ...
2
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...
0
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...
3
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
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...
1
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.*;...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...

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.