Color of jpeg image

Discussion in 'Java' started by oetting@gmail.com, Sep 29, 2005.

  1. Guest

    Hi

    I have made a small applet that resizes images and posts them to a
    webserver. I am using the JIMI api, i find this simple and versitile.

    But when i resize a bright and nice image with the color model Adobe
    RGB the colors get dull. When i look at the resized image the
    colormodel is generic rgb. If i change this to sRGB using the "preview"
    application on my mac, the colors get nice again.
    How do i change the colormodel of my generated images using java.
    I have been looking at java.awt.color and som IIC stuff, but I dont
    seem to understand it. I cant get it working
    Can anyone help me?

    Jacob Oettinger
     
    , Sep 29, 2005
    #1
    1. Advertising

  2. Oliver Wong Guest

    <> wrote in message
    news:...
    > Hi
    >
    > I have made a small applet that resizes images and posts them to a
    > webserver. I am using the JIMI api, i find this simple and versitile.
    >
    > But when i resize a bright and nice image with the color model Adobe
    > RGB the colors get dull. When i look at the resized image the
    > colormodel is generic rgb. If i change this to sRGB using the "preview"
    > application on my mac, the colors get nice again.
    > How do i change the colormodel of my generated images using java.
    > I have been looking at java.awt.color and som IIC stuff, but I dont
    > seem to understand it. I cant get it working
    > Can anyone help me?


    I wouldn't know where to look in the Java API, but if you want to hack
    your own solution, there's a conversion table for different RGB-based color
    models located at: http://en.wikipedia.org/wiki/RGB_color_space

    Just do a few matrix multiplications and you're set! =)

    - Oliver
     
    Oliver Wong, Sep 29, 2005
    #2
    1. Advertising

  3. Roedy Green Guest

    On 29 Sep 2005 13:11:53 -0700, wrote or quoted :

    > If i change this to sRGB using the "preview"
    >application on my mac, the colors get nice again.


    I suspect this might have something do with gamma correction which can
    be looked at a species of contrast knob.

    The problem is SOMEWHERE along the line you need to correct for the
    non-linear behaviour of the monitor. It pretty easy to do the
    correction twice or not at all. Perhaps eventually correction will be
    a purely hardware function and all images and software will ignore the
    problem. Until then, too many cooks...

    For a generic intro to the problem see
    http://mindprod.com/jgloss/gamma.html

    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Again taking new Java programming contracts.
     
    Roedy Green, Sep 30, 2005
    #3
  4. Guest

    Thank you both for your answers. I have looked at your suggestions but
    have so far not been able to solve my problem.

    I will try asking in the jav forum at sun.

    Thank you

    /Jacob
     
    , Oct 7, 2005
    #4
  5. Roedy Green Guest

    On 29 Sep 2005 13:11:53 -0700, wrote or quoted :

    >But when i resize a bright and nice image with the color model Adobe
    >RGB the colors get dull. When i look at the resized image the
    >colormodel is generic rgb. If i change this to sRGB using the "preview"
    >application on my mac, the colors get nice again.


    to understand what is happening to you see
    http://mindprod.com/gamma.html

    There are times like this when I am amazed at human stupidity that
    they can't solve this problem. It is not a technical problem. It is
    about making a decision who is going to do the gamma correction and
    how you mark that it has been done. It seems to me it should be done
    in the device driver or the video hardware card or monitor. You need
    to push it to the last minute since you don't know the characteristics
    of the distortion ahead of time.



    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Again taking new Java programming contracts.
     
    Roedy Green, Oct 8, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. RobertH
    Replies:
    3
    Views:
    4,784
    RobertH
    Feb 17, 2004
  2. =?Utf-8?B?RGFuaWVsIENoYWl0?=

    HtmlInputFile: mimetype of image/jpeg vs image/pjpeg?

    =?Utf-8?B?RGFuaWVsIENoYWl0?=, Oct 20, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    937
    =?Utf-8?B?RGFuaWVsIENoYWl0?=
    Oct 20, 2004
  3. lovaspillando
    Replies:
    0
    Views:
    1,031
    lovaspillando
    Aug 26, 2007
  4. Ivan Alameda Carballo
    Replies:
    0
    Views:
    492
    Ivan Alameda Carballo
    Aug 26, 2007
  5. Kamaljeet Saini
    Replies:
    0
    Views:
    430
    Kamaljeet Saini
    Feb 13, 2009
Loading...

Share This Page