mosaic-generator


Ganerates a mosaic of factorio items from an input image.

2 years ago
1.1
96

g Request for the code

1 year, 11 months ago

This is super interesting! I'm curious, as a programmer at heart, to see what's going on under the hood. Is the source code available?

1 year, 11 months ago

yea unzip the mod, its all in there.

mosaicGenerator.html contains the dithering algorithm. written in javascript.
converts a bitmap to a string, the string has image width as a wee header followed by the list of items.
https://github.com/dave5625/factorioMosaicGenerator is a minor update of that html, didnt feel worth spamming an update here. its a hacky attempt to limit dithering debt bleeding between different colours.

then control.lua reads the string and places the items in the world.

you're welcome to do anything with, without giving credit.

whats not in there is how i derived the pallete of colours. i ad hoc created the string that would place swatches of every item. then with the screenshot, made a thing to take the average pixel value of each swatch.

New response