-
Notifications
You must be signed in to change notification settings - Fork 0
Bitmap
CrocBlanc edited this page Aug 29, 2025
·
7 revisions
see import
local bitmap = dofile("bitmap.lua")
OR
local bitmap = import("https://raw.githubusercontent.com/CrocBlancYT/computer-craft-libraries/refs/heads/main/src/bitmap.lua")local bitmap_obj = bitmap.loadFromFile("file-name.bmp")local bin = https.get("https://github.com/CrocBlancYT/computer-craft-libraries/blob/main/demo/demo.bitmap1.bmp").readAll()
local bitmap_obj = bitmap.loadFromBinary(bin)bitmap_obj:saveToFile("output.bmp")local bin = bitmap_obj:unload()bitmap_obj:setPixel(x,y, R,G,B)local RGB = bitmap_obj:getPixel(x,y)Bitmap object
{
fileName: string,
fileSize: number,
width: number,
height: number,
img: table,
headers: table
bin: string,
}
img
{ [y][x] = {R,G,B} }
headers
{
type: number,
fileSize: number,
reserved: number,
offset: number,
DIB_header_size: number,
width: number,
height: number,
colorPlanes: number,
bitsPerPixel: number,
compressionMethod: number,
rawSize: number,
horizontalResolution: number,
verticalResolution: number,
colorsInPalette: number,
importantColors: number,
}