public final class JetpImageUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.awt.Color |
brightenColor(java.awt.Color c,
int percent)
Brightens a given color for a percent; Negative values darken the color.
|
static byte[] |
dither(java.awt.Image image) |
static void |
dither(int[] buffer,
int width)
Floyd-steinberg dithering with serpentine scanning
|
static java.nio.ByteBuffer |
dither2Minecraft(int[] buffer,
int width) |
static java.awt.image.BufferedImage |
ditherImage(java.awt.Image image) |
static byte |
getBestColor(int rgb) |
static byte |
getBestColor(int red,
int green,
int blue) |
static byte |
getBestColorIncludingTransparent(int rgb) |
static int |
getBestFullColor(int red,
int green,
int blue) |
static int |
getColorFromMinecraftPalette(byte val) |
static int |
getLargestColorVal() |
static int[] |
getRGBArray(java.awt.image.BufferedImage image) |
static int[] |
getSubImage(int topCornerX,
int topCornerY,
int width,
int height,
int[] image,
int imageWidth)
Dither an rgb buffer
|
static int[] |
getSubsegment(int start,
int length,
int substart,
int sublength) |
static void |
init() |
static void |
main(java.lang.String[] args) |
static int |
mediateARGB(int c1,
int c2) |
static int |
mixColors(int color1,
int color2) |
static void |
overlay(int x,
int y,
int[] image,
int imageWidth,
int[] canvas,
int canvasWidth) |
static int |
overwriteColor(int baseColor,
int overlay)
Takes in 2 colors and sets one as the foreground
|
static byte[] |
resize(byte[] data,
int originalWidth,
int width,
int height) |
static byte[] |
rotate(byte[] original,
int width,
byte[] copy,
int copyWidth,
double radians) |
static byte[] |
simplify(int[] buffer) |
static java.awt.image.BufferedImage |
toBufferedImage(java.awt.Image img) |
public static void main(java.lang.String[] args)
public static final void init()
public static int getLargestColorVal()
public static int getColorFromMinecraftPalette(byte val)
public static byte getBestColorIncludingTransparent(int rgb)
public static byte getBestColor(int rgb)
public static byte getBestColor(int red, int green, int blue)
public static int getBestFullColor(int red, int green, int blue)
public static byte[] simplify(int[] buffer)
public static java.awt.image.BufferedImage ditherImage(java.awt.Image image)
public static byte[] dither(java.awt.Image image)
public static void dither(int[] buffer, int width)
public static java.nio.ByteBuffer dither2Minecraft(int[] buffer, int width)
public static int[] getSubImage(int topCornerX, int topCornerY, int width, int height, int[] image, int imageWidth)
width
- The width of the imagebuffer
- RGB bufferpublic static void overlay(int x, int y, int[] image, int imageWidth, int[] canvas, int canvasWidth)
public static java.awt.image.BufferedImage toBufferedImage(java.awt.Image img)
public static int[] getRGBArray(java.awt.image.BufferedImage image)
public static int[] getSubsegment(int start, int length, int substart, int sublength)
public static byte[] resize(byte[] data, int originalWidth, int width, int height)
public static byte[] rotate(byte[] original, int width, byte[] copy, int copyWidth, double radians)
public static int overwriteColor(int baseColor, int overlay)
baseColor
- The background coloroverlay
- The foregroundpublic static int mixColors(int color1, int color2)
public static int mediateARGB(int c1, int c2)
public static java.awt.Color brightenColor(java.awt.Color c, int percent)
c
- The color to brighten.percent
- The percentage to brighten; Must not exceed 100 percent.