- Added shrink docs

- Added shrink documentation which is based on pixelbox by 9551Dev
This commit is contained in:
Robert Jelic
2023-05-08 17:31:02 +02:00
parent dc4584eb60
commit 4a5eaf324a
3 changed files with 42 additions and 8 deletions

View File

@@ -0,0 +1,24 @@
## getShrinkedImage
### Description
The getShrinkedImage method generates a Blit-Image version of a standard Image object and returns it as a table. By using this method, the resulting image will only retain the background (BG) data, and both foreground (FG) and text information will be lost.
Shrinking the image is calculated by pixelbox, a algorithm created by 9551Dev. You can find his awesome work [here](https://github.com/9551-Dev/apis/blob/main/pixelbox_lite.lua)!
### Returns
1. `table` A table representing the Blit-Image version of the Image object, containing only the background data.
### Usage
* Creates a default image and loads a test.nfp file
```lua
local basalt = require("basalt")
local mainFrame = basalt.createFrame()
local image = mainFrame:addImage:loadImage("path/to/your/image.nfp")
local blitImage = image:getShrinkedImage()
```