Updated sprites
|
Before Width: | Height: | Size: 211 B After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 303 B After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 294 B After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 404 B After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 395 B After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 251 B After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 261 B After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 245 B After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 351 B After Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 1015 B After Width: | Height: | Size: 9.0 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 814 B After Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 212 B After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 170 B After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 308 B After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 497 B After Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 322 B After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 613 B After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 205 B After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 577 B After Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 647 B After Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 205 B After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 619 B After Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 224 B |
|
Before Width: | Height: | Size: 143 B After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 529 B After Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 9.6 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 933 B |
|
Before Width: | Height: | Size: 988 B After Width: | Height: | Size: 8.8 KiB |
|
Before Width: | Height: | Size: 303 B |
|
Before Width: | Height: | Size: 294 B After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 704 B After Width: | Height: | Size: 699 B |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 246 KiB After Width: | Height: | Size: 248 KiB |
|
Before Width: | Height: | Size: 134 KiB After Width: | Height: | Size: 134 KiB |
|
Before Width: | Height: | Size: 158 KiB After Width: | Height: | Size: 159 KiB |
|
Before Width: | Height: | Size: 219 KiB After Width: | Height: | Size: 222 KiB |
|
Before Width: | Height: | Size: 376 KiB After Width: | Height: | Size: 380 KiB |
|
Before Width: | Height: | Size: 299 KiB After Width: | Height: | Size: 300 KiB |
@@ -3,7 +3,9 @@ apply plugin: "java"
|
|||||||
sourceCompatibility = 1.8
|
sourceCompatibility = 1.8
|
||||||
sourceSets.main.java.srcDirs = ["src/"]
|
sourceSets.main.java.srcDirs = ["src/"]
|
||||||
|
|
||||||
|
|
||||||
import com.badlogic.gdx.graphics.Color
|
import com.badlogic.gdx.graphics.Color
|
||||||
|
import com.badlogic.gdx.utils.IntArray
|
||||||
import com.badlogic.gdx.tools.texturepacker.TexturePacker
|
import com.badlogic.gdx.tools.texturepacker.TexturePacker
|
||||||
|
|
||||||
import javax.imageio.ImageIO
|
import javax.imageio.ImageIO
|
||||||
@@ -86,18 +88,48 @@ def antialias = { File file ->
|
|||||||
ImageIO.write(out, "png", file)
|
ImageIO.write(out, "png", file)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def medianBlur = { File file ->
|
||||||
|
def image = ImageIO.read(file)
|
||||||
|
def result = new BufferedImage(image.width, image.height, BufferedImage.TYPE_INT_ARGB)
|
||||||
|
def radius = 4
|
||||||
|
IntArray array = new IntArray()
|
||||||
|
|
||||||
|
def getRGB = { int ix, int iy ->
|
||||||
|
return image.getRGB(Math.max(Math.min(ix, image.width - 1), 0), Math.max(Math.min(iy, image.height - 1), 0))
|
||||||
|
}
|
||||||
|
|
||||||
|
for(int x = 0; x < image.width; x++){
|
||||||
|
for(int y = 0; y < image.height; y++){
|
||||||
|
array.clear()
|
||||||
|
|
||||||
|
for(int dx = -radius; dx <= radius; dx ++){
|
||||||
|
for(int dy = -radius; dy <= radius; dy ++){
|
||||||
|
if(dx*dx + dy*dy <= radius*radius){
|
||||||
|
array.add(getRGB(x + dx, y + dy))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
array.sort()
|
||||||
|
|
||||||
|
result.setRGB(x, y, array.get((int)(array.size / 2)))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ImageIO.write(result, "png", file)
|
||||||
|
}
|
||||||
|
|
||||||
def scaleImage = { File file ->
|
def scaleImage = { File file ->
|
||||||
def image = ImageIO.read(file)
|
def image = ImageIO.read(file)
|
||||||
for(int iteration in 0..1){
|
for(int iteration in 0..1){
|
||||||
def scaled = new BufferedImage(image.getWidth() * 2, image.getHeight() * 2, BufferedImage.TYPE_INT_ARGB)
|
def scaled = new BufferedImage(image.width * 2, image.height * 2, BufferedImage.TYPE_INT_ARGB)
|
||||||
|
|
||||||
def getRGB = { int ix, int iy ->
|
def getRGB = { int ix, int iy ->
|
||||||
//if(ix <= 0 || iy <= 0 || ix >= image.width || iy >= image.height) return 0
|
|
||||||
return image.getRGB(Math.max(Math.min(ix, image.width - 1), 0), Math.max(Math.min(iy, image.height - 1), 0))
|
return image.getRGB(Math.max(Math.min(ix, image.width - 1), 0), Math.max(Math.min(iy, image.height - 1), 0))
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int x = 0; x < image.getWidth(); x++){
|
for(int x = 0; x < image.width; x++){
|
||||||
for(int y = 0; y < image.getHeight(); y++){
|
for(int y = 0; y < image.height; y++){
|
||||||
int p = image.getRGB(x, y)
|
int p = image.getRGB(x, y)
|
||||||
int p1 = p, p2 = p, p3 = p, p4 = p
|
int p1 = p, p2 = p, p3 = p, p4 = p
|
||||||
|
|
||||||
|
|||||||