A small, dependency-free library for Go which creates deterministic 'art' Images from UUIDs
This was mostly writen using an LLM. See my FAQ section at the bottom for why.
To make it clear who has written what i have commented each function within the code with either:
// written by: rich-28if it was written by me// written by: Claude Fable at Maxto indicate it was written by the LLM (in this case my free trial of Claude Fable at MAX effort).// written by: Claude Fable at Max. Edited by rich-28to show it was written by the LLM then edited by me// written by: rich-28. Helped by Claude Fable at Maxto show it was written by me then edited by the LLM
- Create image.RGBA images
- Create png files at a passed path
- Takes either a uuid as a
[16]byteor astring - Can set the image size
PNG or image.RGBA images produces are always square and the size of the image is determined by
setting the exported package-level variable ImageSize to whatever int value you like. e.g.
uuidart.ImageSize = 512The default is 1024 which gives a good level of detail for the 'art' generated.
If you do something too small like 1 then it doesnt matter how many uuids you give it you arent going
to get much variation.
uuidart.ImageSize = 1See the example of a ImageSize of 1 at test_data/10000000-0000-0000-0000-000000000000.png.
It is there i promise you, just very small
If you set it some large then the amount of time it takes to generate the image will go up wildly. You have been (somewhat) warned.
go get github.com/rich-28/uuidartpackage main
import "github.com/rich-28/uuidart"
func main() {
// creates an image for the uuid 01c9a597-74cd-40b4-add8-5e08957fb4cf under the
// `/tmp` directory the file will be called 01c9a597-74cd-40b4-add8-5e08957fb4cf.png
// loc contains the full file path as a string while
loc, err := uuidart.CreateArtFileFromUuidString("01c9a597-74cd-40b4-add8-5e08957fb4cf", "/tmp")
if err != nil {
panic("something went wrong...")
}
...
}TODO
See the LICENSE file for details.
Honestly i'd had one to many gin and tonics during a heatwave and thought it would be fun
Maybe. i did a quick google and few things that turn them into emojis etc came up but nothing exactly like this
I've got a full time job and a 2 year old at home, i aint got time for nothing anymore. I came up with an interesting
idea and rather then neglect my duties as a husband and a father to work out how to do this i got my LLM to
work it out for me then using what free time i can work out during weekend naps i did the rest.
Could have i have done this myself? probably but it would have taken me a longer than i care to admit.
Yep. I used the unit testing to as the mechanism to understand the code the LLM wrote. My rational being that the LLM is smarter than me so i can have a level of assumption that the code it has written is good and functioning, especially after a test. What i aim to do is make sure that if i change something within the code base i'm not breaking anything the LLM has written (hence the lots of 'does this input equal this output' unit testing) i found this also helped me go through the code in a methodical way.

