Skip to content
rich-28Public

About

Deterministic Images from UUIDs

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

Repository files navigation

uuid-art

uuidart

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.

Who Wrote What

To make it clear who has written what i have commented each function within the code with either:

  • // written by: rich-28 if 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-28 to show it was written by the LLM then edited by me
  • // written by: rich-28. Helped by Claude Fable at Max to show it was written by me then edited by the LLM

Features

  • Create image.RGBA images
  • Create png files at a passed path
  • Takes either a uuid as a [16]byte or a string
  • Can set the image size

Notes - ImageSize

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 = 512

The default is 1024 which gives a good level of detail for the 'art' generated.

Setting it too small

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 = 1

See 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

Setting it too larger

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.

Installation

go get github.com/rich-28/uuidart

Quick start

package 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...")
	}
	...
}

Example Art

UUID: 01c9a597-74cd-40b4-add8-5e08957fb4cf.png

01c9a597-74cd-40b4-add8-5e08957fb4cf.png

UUID: aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa.png

aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa.png

Documentation

TODO

License

See the LICENSE file for details.

FAQs (well assumed FAQs, no one asked me anything)

Why do this?

Honestly i'd had one to many gin and tonics during a heatwave and thought it would be fun

Are there other things like this?

Maybe. i did a quick google and few things that turn them into emojis etc came up but nothing exactly like this

Why use an LLM?

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.

Thats a lot of unit testing...?

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.

About

Deterministic Images from UUIDs

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages