All Mods Resource Packs Data Packs Shaders Modpacks Plugins
scarpet-graphics

scarpet-graphics

by replaceitem • Downloads: 0 • Followers: 0
Description
Gallery
Changelog
Versions

scarpet-graphics

A wrapper of Processing for scarpet

This can also be used with Discarpet to send the created images via Discord.

Values

This extension adds these new scarpet values:

  • image: Wrapper for PImage
  • graphics: Wrapper for PGraphics, extends image value (meaning it can be used in the same way image can)
  • font: Wrapper for PFont

Colors are handled using numbers (0xRRGGBBAA in hex), but can be constructed from RGB and HSB using the color function.

Functions

For a more detailed documentation for these functions, see the Processing reference Most functions are just a wrapper function for the internal processing function. Sometimes they may have slightly different names than the original Processing functions, due to the name being already used by scarpet (e.g. copy()) or to group them (all draw_?() functions).

Graphics and Image functions

load_image(location, shared?)

Loads an image from the specified location (string). Can be a URL, or file name (path that works just like read_file). If shared is true, uses shared app storage. Returns an image value.

save_image(image, location, shared?)

Saves the image in the specified location (works like load_image)

create_graphics(width, height)

Creates a new graphics object with the specified dimensions.

copy_image(source, desination, sourceX, sourceY, sourceW, sourceH, destinationX, destinationY, destinationW, destinationH)

Copies pixels from one image/graphics to another.

get_pixel(image, x, y)

Returns the color of a certain pixel.

set_pixel(image, x, y, color)

Sets the pixel on the image to the color.

begin_draw(graphics)

Prepares the graphics object for doing drawing operations on it.

end_draw(graphics)

To be called when done drawing.

Drawing functions

See the 2D Primitives section in the processing reference. (The scarpet functions have draw_ prefixed with the processing function names)

draw_background(graphics, color)

draw_rect(graphics, a, b, c, d)

draw_ellipse(graphics, a, b, c, d)

draw_line(graphics, x1, y1, x2, y2)

draw_image(graphics, image, a, b, c, d)

draw_text(graphics, text, x, y)

Mode functions

color_mode(graphics, mode)

modes: 'RGB', 'HSB'

image_mode(graphics, mode)

modes: 'CORNER', 'CORNERS', 'CENTER'

ellipse_mode(graphics, mode)

modes: 'CORNER', 'CORNERS', 'CENTER', 'RADIUS'

rect_mode(graphics, mode)

modes: 'CORNER', 'CORNERS', 'CENTER', 'RADIUS'

Utility functions

color(graphics, v1, v2, v3, alpha)

Depending on the color_mode() set, v1,v2,v3 are either r,g,b or h,s,b values

fill(graphics, color)

no_fill(graphics)

stroken(graphics, color)

no_stroke(graphics)

stroke_weight(graphics, weight)

smooth(graphics)

no_smooth(graphics)

font_list() (Equivalent to PFont.list() in processing)

text_font(graphics, font)

text_size(graphics, size)

create_font(graphics, name, size, smooth?)

text_align(graphics, alignX, alignY)

How to Install scarpet-graphics (Mod)

scarpet-graphics by replaceitem is verified for Fabric across Minecraft versions 1.19.1, 1.19.2, 1.19.4, 1.20, 1.20.1, 1.20.2, 1.20.5, 1.20.6 (latest release: 0.1.7, file size: 1,003 KB). Follow the steps below to install it safely from ModCraft.tv:

  1. Click the Download button above and select your Minecraft version (1.19.1, 1.19.2, 1.19.4, 1.20, 1.20.1, 1.20.2, 1.20.5, 1.20.6) and platform (Fabric).
  2. Make sure you have the compatible loader or environment installed for Fabric.
  3. Move the downloaded scarpet-graphics file into your Minecraft .minecraft/mods folder and launch the game.

All Versions

+ Add Version
Name Game version Platforms Published Downloads Actions
26.3 26.2 26.1.x
Fabric
7mo ago 1
1.21.x 1.20.x
Fabric
last yr. 1
1.20.x 1.19.4
Fabric
last yr. 1
1.19.x
Fabric
last yr. 1
1.19.x
Fabric
last yr. 1
1.19.1
Fabric
last yr. 1
[0.1.7] 0.1.7 by replaceitem on Apr 08, 2026
Download
  • Updated to Minecraft 26.1
  • Made load_image and save_image use the scarpet file system and no longer allow absolute paths.
[0.1.6] 0.1.6 by replaceitem on Apr 23, 2024
Download
  • Updated to Minecraft 1.19.4
[0.1.5] 0.1.5 by replaceitem on Mar 20, 2023
Download
  • Updated to Minecraft 1.19.4
[0.1.4] 0.1.4 by replaceitem on Aug 11, 2022
Download
Changed processing to be api implemented
[0.1.3] 0.1.3 by replaceitem on Aug 11, 2022
Download
Added new api method for discarpet
[0.1.2] 0.1.2 by replaceitem on Jul 31, 2022
Download
First modrinth release.

Previous releases: https://github.com/replaceitem/scarpet-graphics/releases
scarpet-graphics Icon
Download scarpet-graphics
Select game version
Select platform