discoloration around text...

T

tiewknvc9

hi!

im writing a program that (first) creates a standard colored background
with some text drawn in front of it (with drawstring) -- all in a
graphics2D object.

Then I save the bufferedImage of the graphics2D object to the disk as a
jpeg.

I cannot see the graphics2D object that is being created, I only see
the output.

However the outputted jpeg, (which again is a VERY simple graphic
containing text and a background), appears to be pixellated all around
the text. What I mean is that there is a discoloration. Some pixels
around the text appear in variously similar colors to the background.

unfortunately I require a perfected image that has no discoloration.

any ideas?
 
O

Oliver Wong

tiewknvc9 said:
hi!

im writing a program that (first) creates a standard colored background
with some text drawn in front of it (with drawstring) -- all in a
graphics2D object.

Then I save the bufferedImage of the graphics2D object to the disk as a
jpeg.

I cannot see the graphics2D object that is being created, I only see
the output.

However the outputted jpeg, (which again is a VERY simple graphic
containing text and a background), appears to be pixellated all around
the text. What I mean is that there is a discoloration. Some pixels
around the text appear in variously similar colors to the background.

unfortunately I require a perfected image that has no discoloration.

any ideas?

Don't use JPEG. Use, for example, PNG or BMP.

- Oliver
 
E

Eric Sosman

tiewknvc9 wrote On 05/08/06 17:09,:
hi!

im writing a program that (first) creates a standard colored background
with some text drawn in front of it (with drawstring) -- all in a
graphics2D object.

Then I save the bufferedImage of the graphics2D object to the disk as a
jpeg.

I cannot see the graphics2D object that is being created, I only see
the output.

However the outputted jpeg, (which again is a VERY simple graphic
containing text and a background), appears to be pixellated all around
the text. What I mean is that there is a discoloration. Some pixels
around the text appear in variously similar colors to the background.

unfortunately I require a perfected image that has no discoloration.

You probably shouldn't use JPEG for this application.
JPEG was designed for "real-world" images, not for synthetic
images with "cartoon-like" sharp edges. See Question 3 in
the JPEG FAQ

http://www.faqs.org/faqs/jpeg-faq/part1/
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top