Java Slick scale Image without smoothing

In the Slick library (based on LWJGL) you can scale images after loading with getScaledCopy , but anti-aliasing will be applied. I want the edges to remain rough; I create pixel art. How can i do this?

+6
source share
1 answer

Based on the comments:

The documentation assumes that the filter Image property controls the scaling of images. To scale the image without anti-aliasing, use the nearest neighbor filter :

 Image original = …; original.setFilter(Image.FILTER_NEAREST); Image scaled = original.getScaledCopy(); 
+7
source

Source: https://habr.com/ru/post/916959/