In the Slick library (based off of LWJGL), you can scale images after you load them with getScaledCopy
, but it will apply anti-aliasing. I want the edges to stay rough; I'm making pixel art. How can I do this?
Java Slick scale Image without anti-aliasing
Asked Answered
Based on the comments:
The documentation implies that the filter
property of Image
s controls how images are scaled. To scale an image without smoothing, use the nearest neighbour filter:
Image original = …;
original.setFilter(Image.FILTER_NEAREST);
Image scaled = original.getScaledCopy();
© 2022 - 2024 — McMap. All rights reserved.
setFilter()
to set the image filter toFILTER_NEAREST
before scaling the image. – Arabic