Solved

Image quality reduction

Posted on 1997-03-13
2
213 Views
Last Modified: 2012-06-27
I have emade a couple of applets showing a slideshow with images.
When the images (gif or jpg) appear in the applet, the quality is
reduced from the original image. It seem like they show up in 16 colors
or non-dithered or something.
I have tried different images, but the problem appear each time.
Doesnt java support a 256 color dithered gif ??

0
Comment
Question by:apriks
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Accepted Solution

by:
amarshal earned 50 total points
ID: 1219004
When a true color (16-Million) display is not available, the majority of Java platforms convert the image into Web colors, a 256-color pallete agreed upon by all browsers.

The best answer I have to fix this problem is to convert the images to Web colors, as a gif, before you upload them.  Photoshop does an excellent job of converting the images, and 4.0 has an option under mode-indexed color to choose web colors directly.  It will look a little bit dithered by being in 256 color mode, but Photoshop's algorithm is much better.
0
 
LVL 2

Expert Comment

by:mgk
ID: 1219005
You can fix the dithering problem with Netscape by creating the image again from a memory source.

Check out http://www.powerup.com.au/~mgk/java/banner.html, if you view source you will see that most of the banners are full colour GIFs. In this case I ran it all through a Filter that did nothing to the image data, but you could also convert all the data into an array and then create an image with it. Images created from memory don't dither. Here's the code:

Image tempimage=getImage(getCodeBase(),getParameter("banner"+i));
ImageFilter f=new FixDither();
ImageProducer producer=new FilteredImageSource(tempimage.getSource(),f);
image=this.createImage(producer);


class FixDither extends RGBImageFilter {
  public void FixDither() {
    canFilterIndexColorModel = true;
  }
      
  public int filterRGB(int x, int y, int rgb) {
    return rgb;
  }
}
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question