Modding:Image Processing Directives

From Starbounder - Starbound Wiki
Jump to: navigation, search

Image Directives

Directives are assumed to be applied in direct left-to-right order.

Whenever colors are mentioned, they should be valid six or eight-digit hexadecimal color codes. The last two digits of an eight-digit color code represents the alpha value of the color; an optional value in most directives. Color codes are case-insensitive.

"FFFFFF" (white)

"0000007F" (black, semitransparent)


Base image used in examples:

/interface/cockpit/initiatejumpover.png

SBDirectives-Base.png

setcolor

Adjusts the RGB values of all pixels on the image to the given value, including semitransparent pixels. The alpha value of each pixel remains untouched.

Usage
"<file>?setcolor=<color>"
Example
"/interface/cockpit/initiatejumpover.png?setcolor=8888FF"
SBDirectives-SetColor.png

replace

A directive to apply palette swap on the image. Changes the color of all pixels colored "from" to "to". If no alpha value is given to replace, only opaque pixels are replaced. Likewise, if no alpha value is given as the new color, matching pixels will result fully opaque.

Usage
"<file>?replace;<colorFrom1>=<colorTo1>;<colorFrom2>=<colorTo2>"
Example
"/interface/cockpit/initiatejumpover.png?replace;D9B035=778FD8;B0811D=5C6FA5;FBDF71=8EAAFF"
SBDirectives-Replace.png

hueshift

Adjusts the hue of each color by the given amount of degrees.

Usage
"<file>?hueshift=<degrees>"
Example
"/interface/cockpit/initiatejumpover.png?hueshift=180"
SBDirectives-Hueshift.png

brightness

Increases or decreases the brightness of the image by the given percentage. Values above 100 and below -100 will result in the same as 100 or -100 respectively.

Usage
"<file>?brightness=<difference>"
Example
"/interface/cockpit/initiatejumpover.png?brightness=0"
"/interface/cockpit/initiatejumpover.png?brightness=-50"
"/interface/cockpit/initiatejumpover.png?brightness=-100"
SBDirectives-Brightness.png

saturation

Usage
"<file>?saturation=<difference>"
Example
"/interface/cockpit/initiatejumpover.png?saturation=50"
SBDirectives-Saturation.png

Note: Same rules as brightness.

border

Draws a border <pixels> wide around the outer contour of the image content (only opaque parts are outlined). Note that the border has the same scale as the image itself.

Usage
"<file>?border=<pixels>;<innerColor>;<outerColor>"
Example
"/interface/cockpit/initiatejumpover.png?border=10;FF0000;0000FF"
SBDirectives-Border.png

crop

Usage
"<file>?crop=<left>;<bottom>;<right>;<top>"
Example
"/interface/cockpit/initiatejumpover.png?crop=14;2;43;32"
SBDirectives-Crop.png

Note: Although the rest of the image is gone, the position of this frame is still the same as without cropping, meaning you may have to compensate by adjusting the image position.

flipx / flipy / flipxy

Usage
"<file>?flipx"
"<file>?flipy"
"<file>?flipxy"
Example
"/interface/cockpit/initiatejumpover.png?flipx?flipy"
SBDirectives-FlipXFlipY.png

multiply

Usage
"<file>?multiply=<color>"
Example
"/interface/cockpit/initiatejumpover.png"
"/interface/cockpit/initiatejumpover.png?multiply=FFFFFF00"
"/interface/cockpit/initiatejumpover.png?multiply=FFFFFF80"
SBDirectives-Multiply.png

fade

Usage
"<file>?fade=<color>=<amount>"
Example
"/interface/cockpit/initiatejumpover.png?fade=0"
"/interface/cockpit/initiatejumpover.png?fade=0.5"
"/interface/cockpit/initiatejumpover.png?fade=1"
SBDirectives-Fade.png

scale / scalenearest / scalebicubic / scalebilinear

Usage
"<file>?<scaleMethod>=<factor>"
"<file>?<scaleMethod>=<factor_x>;<factor_y>"
Example
"/interface/cockpit/initiatejumpover.png?scalenearest=0.5"
"/interface/cockpit/initiatejumpover.png?scalebicubic=0.5;1.5"
SBDirectives-ScaleBicubic.png

Note: Scales around the center of the image (meaning the center of the scaled image is at the same position as the center of the original image). This means you may have to compensate by adjusting the position of the image.

addmask

Usage
"<file>?addmask=<path>"
Unconfirmed: "<file>?addmask=<path>;<startX>;<startY>"
Example
"/interface/crafting/bgselection1.png?addmask=/interface/crafting/bgselection6.png"
bgselection1.png:
SBDirectives-AddMask2a.png
bgselection6.png:
SBDirectives-AddMask2b.png
Result:
SBDirectives-AddMask2r.png

submask

Usage
?
Example
?


Note: The transparent pixels on the mask will be removed on the original image. The result only shows pixels (in their original form) that are found on both the original image as the applied mask.

blendmult/blendscreen

Blends two images with multiplication (or screen)

Usage
"<file>?blendmult=<file2>;x;y"
Example
?




Quick Navigation