Image Qualität

hares

Grünschnabel
Hi leute, ich weiss nicht mehr weiter!

ich zeichne gerade ein Mandelbrot, soll eigentlich nur in ein File geschrieben werden, jedoch weiss ich nicht wie ich die Qualität des Images verbessern kann, hab auch schon probiert die Gösse zu verändern, jedoch Hilft das nicht wirklich! bitte bitte


hier mein Colormodel und meine offpaint Methode

// fill the colour table with silly color gradients
for (int index = 0; index < NUM_COLORS; ++index)
{
blue [index] = (byte) (64 + index % 64 * 3);
green[index] = (byte) ( 32 + index % 32 * 6);
red [index] = (byte) ( 252 - index % 64 * 4);
}

// add black to the table and create the colour model
blue[NUM_COLORS] = green[NUM_COLORS] = red[NUM_COLORS] = 0;
color_table = new IndexColorModel(8, NUM_COLORS + 1, blue, green, red);
}



public void offpaint (){

System.out.println("Ich war im offpaint()");

int width = w;//getWidth(); // component width
int height = h;//getHeight(); // component height

if (image == null || image.getWidth() != width ||
image.getHeight() != height)
{

byte pixels[] = new byte[width * height];

DataBufferByte buffer; // byte array buffer
WritableRaster raster; // image raster
int x, y; // pixel position

for (x = 0; x < width; ++x) // fill byte array
for (y = 0; y < height; ++y)
{


pixels[(height - 1 ... .....);

}

// use the byte array to fill the PackedRaster and create the
// BufferedImage from the WritableRaster and the ColorModel.

buffer = new DataBufferByte(pixels, pixels.length);
raster = Raster.createPackedRaster(buffer, width, height, 8, null);
image = new BufferedImage(color_table, raster, false, null);
}

offscreenGraphics = image.getGraphics();
offscreenGraphics.drawImage(image, 0, 0, this); // finally: draw it


// write the offscreen image on disk

File output;
File = new File(".\\Image\\mandel_X"+start_x+"_Y_"+start_y+".png");
try {
ImageIO.write(image, "PNG", outputFile);
} catch (Exception e) {
System.err.println(e.getMessage());
}

}

}


aja weil ich gerade dabei bin, hat jemand eine idee wie ich aus einem java programm heraus ein anderes starten kann solte ungfähr so ausschaun

runtime. get...().exec("java prog");

danke danek
 
Zurück