Google Answers Logo
View Question
 
Q: Example Java or Perl program to change colors in a JPEG ( No Answer,   1 Comment )
Question  
Subject: Example Java or Perl program to change colors in a JPEG
Category: Computers > Programming
Asked by: bozo0-ga
List Price: $10.00
Posted: 11 Oct 2005 10:59 PDT
Expires: 12 Oct 2005 11:16 PDT
Question ID: 578934
I would like an example Perl or Java program that I could modify to
manipulate the colors of the pixels in a jpeg file that I created with
my camera.

The program would: 

    1) Take a jpeg file as input.
    2) Manipulate the colors of the pixels.
    3) Write a new jpeg file with the new colors.

I would like the new jpeg file to have no significant loss of quality.

This program is just for me to manipulate my own pictures.  I don?t
care how fast it runs.  I don?t need to see the source code it uses to
read the input file or the source code it uses to write the output
file.  As long as it can do those things, I don?t care how it does
them.

The part I would like to see is the source code it uses to change the
red green and blue values of the pixel.

My operating system is XP.  I have Java 2 Standard Edition SDK and
PERL v5.6.1 from ActiveState.

Clarification of Question by bozo0-ga on 11 Oct 2005 13:51 PDT
Saving the picture as a .bmp first would be OK.
Answer  
There is no answer at this time.

Comments  
Subject: Re: Example Java or Perl program to change colors in a JPEG
From: localh77-ga on 11 Oct 2005 12:42 PDT
 
The problem is that depending on what kind of editing you want to do,
this could be quite complicated.  Jpegs are compressed image files,
which makes them harder to manipulate in code, and on top of that they
are not handled exactly the same by every progam (unlike, say,
bitmaps).  http://en.wikipedia.org/wiki/Jpeg gives a good description
of how complicated they are.  Depending on why you want to do this, it
might make more sense to save the picture as a .bmp first, edit the
.bmp in code, and then save it back as a .jpg.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy