ziran.se

Aseprite script to fill with dot pattern

15 minutes ago or so, I was casually browsing the XXIIVV wiki and the whole lofi/monochrome aesthetic got to me. Suddenly I wanted a desktop wallpaper featuring a monochrome, 2 color design. A simple dot pattern.

desktop wallpaper

Aseprite is my pixel art tool of choice, and one of the many nice features it comes with is the ability to run little scripts very easily. The API is simple enough, and the language used is Lua which I used to use quite a bit some years ago.

Anyway, the script turned out to be really simple to write. I’ve included it below for anyone looking for a really basic example of how to run scripts in Aseprite.

if app.apiVersion < 1 then
  return app.alert("This script requires Aseprite >= v1.2.10")
end

local cel = app.activeCel
if not cel then
  return app.alert("There is no active image")
end

local img = cel.image:clone()
local stride = 8
for x=1,img.width,stride do
  for y=1,img.height,stride do
    img:drawPixel(x, y, app.fgColor)
  end
end
cel.image = img
app.refresh()

Update:

I ended up making a series of these wallpapers. They are all in a 4k-ish wide format to fit my monitor.

Version 2 Version 3 Version 4