Results 1 to 9 of 9
Thread: Image output quality
- 01-24-2009, 09:06 PM #1
Member
- Join Date
- Nov 2008
- Posts
- 5
- Rep Power
- 0
Image output quality
Hi all,
hope here is the right place for this thread, hopefully its a pretty simple question,
basically I have a 1-d array of 2000*1500 integers, each representing a pixel of the image I want to write, and first used:
to write the data to the image, but the quality is pretty bad, definitely a lot worse than is should be for an image that big, and the quality looks the same for any image format.Java Code:data][ = getData(); image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); image.setRGB(0, 0, width, height, data, 0, width); File outFile = new File("/home/linus/Documents/julia1.jpg"); ImageIO.write( image , "jpg", outFile );
After some searching I managed to use an image writer and change the quality parameter from 0.9f to 1.0f but this doesn't make a great deal of difference, I really just need to output the exact pixels specified in the array to an image, it seems somewhere the image is being messed about with, presumably when I make the BufferedImage.
(attatchment is same scale and quality as actual output)
If anyone can suggest a different approach or direct me to some good information about this, would be a big help!
Thanks,
Chris
edit: probably should add, the methods for producing the data aren't the problem, zooming in on any of the smaller "blobs" gives much higher quality.Last edited by linus_k; 01-24-2009 at 09:08 PM.
-
I don't know the answer to your question, but I do recognize that image from somewhere,.... but where? ;)
- 01-24-2009, 10:07 PM #3
Member
- Join Date
- Nov 2008
- Posts
- 5
- Rep Power
- 0
its a bit of the mandelbrot set...would be very pretty if it wasn't so pixellated
-
- 01-24-2009, 10:32 PM #5
Member
- Join Date
- Nov 2008
- Posts
- 5
- Rep Power
- 0
ah lol didn't notice that, looks like it was made with flam3??
yeah me too...currently working on algorithms for drawing julia sets/ hubbard trees but I'm not at all used to java
- 01-24-2009, 11:12 PM #6
> I really just need to output the exact pixels specified in the array to an image
Provided the quality of the BufferedImage (prior to saving) is adequate, you need to save to a lossless file format like PNG (or BMP -- I don't know whether ImageIO supports BMP). The loss of quality is due to JPEG artefacts.
db
- 01-24-2009, 11:24 PM #7
Member
- Join Date
- Nov 2008
- Posts
- 5
- Rep Power
- 0
thanks darryl, will give it a try
- 03-16-2009, 06:02 AM #8
Member
- Join Date
- Jan 2009
- Posts
- 35
- Rep Power
- 0
Image output quality
BMP files are supported, but they are HUGE.
I think the issue is that JPEG files will provide varying amounts of data compression, and it is possible to create a JPEG file without data compression, so that you will get a "perfect" image (like a BMP), but a lot smaller than a BMP, because the data is stored more efficiently (like specifying that the data repeats over a sequence of pixels, rather than specifying each individual pixel, which is done in a BMP file).
So the question is, how do you get more control over how a JPEG file is created? How do you specify the desired data compression?
-scott
- 03-16-2009, 05:49 PM #9
Member
- Join Date
- Jan 2009
- Posts
- 35
- Rep Power
- 0
Similar Threads
-
How to draw 2 images with quality?
By Panchitopro in forum Java 2DReplies: 1Last Post: 03-12-2009, 08:31 AM -
Canvas Image popups another image (SWT)
By SpaceY in forum New To JavaReplies: 2Last Post: 11-11-2008, 01:25 PM -
drawing an image to an offscreen image
By hunterbdb in forum Java 2DReplies: 9Last Post: 10-30-2008, 06:17 PM -
Why the output is always zero
By mehrotra.chitij in forum New To JavaReplies: 12Last Post: 04-25-2008, 04:05 AM -
Converting multiple banded image into single banded image... Image enhancement
By archanajathan in forum Advanced JavaReplies: 0Last Post: 01-08-2008, 05:29 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks