# Java image in JFrame rendered weirdly

I'm not sure if this is intended or not, if it is, I'd like to know a way of preventing this: I've got this image (which is for testing purposes, the actual one has a texture, but I'm not using it right now): Zoomed in, it looks like this in the JFrame:

These small 'arrangements' are what bothers me, because the image itself should be plain green, just as it is when viewing the tile image with a separate viewer
(like that:)

OOO
--O--
O--O

In the end, drawn as a tilemap, it looks like this (I'm changing the rgb values, that's why it's coloured differently on the left):

My Code: (It draws 15 horizontal tiles and 10 vertical tiles, the orange ones are another piece of code which is irrelevant right now)

BufferedImage singleTile;
try {
singleTile = ImageIO.read(new File(filename));
} catch (IOException e) {
e.printStackTrace();
return;
}
BufferedImage finalImg = new BufferedImage(tilesX*scaledTileSize, tilesY*scaledTileSize, singleTile.getType());
for(int i = 0; i < tilesX; i++){
for(int j = 0; j < tilesY; j++){
finalImg.createGraphics().drawImage(singleTile, i*scaledTileSize, j*scaledTileSize, scaledTileSize, scaledTileSize, null);
}
}

• I feel like this has something to do with filtering, can’t write a full answer right now, but play around with smooth vs fast filtering. – Evgeny Vasilyev Sep 8 '18 at 1:42