Commit Graph

22 Commits

Author SHA1 Message Date
88ceb5e2ff Add PNGWriter
* png files are an available output in the CLI
* --svg-square-size is now --square-size
* output type of Writer.write is bytes instead of a string. Just use
  str.decode if string output is needed

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-06-04 21:58:31 -07:00
1758d477a8 Update js/index.html to include available hash algorithms
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-06-03 12:32:52 -07:00
d61da024c9 Run black
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-06-03 12:23:08 -07:00
c17326f4e7 Refactor matricizer, fix some linter complaints
* Matricizer.choose_dimensions was not actually being used. It has been
  removed, and dimensions of the hash matrix are now determined
  internally by the matricizer, rather than in its constructor.
* Linter was complaining about missing documentation and some other
  minor styling things so those are fixed
* Linter had a few more stupid lints enabled ("too-many-statements"?
  really? god forbid your code is too long, I'm not a computer science
  student, come on guys)

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-06-03 12:20:07 -07:00
2b30070851 Remove colorizer.py in reference to the last commit
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-06-03 11:49:21 -07:00
ca2aa4ca3b Refactor colorizer
Colorizer was a class-based thing but it doesn't really need to be,
because everything is colorized using palettes. If we need to use a
different style of colorization in the future, we will bring the
colorizer class back.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-06-03 11:24:31 -07:00
c416c24a9c Add Javascript implementation
Add a simple JS port of colorhash for easier demonstration purposes. You
don't need to open a command line to create a colorhash, you can just
use the webpage.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-06-03 11:16:07 -07:00
6091170ed4 Fix fatal bug in RandomartMatricizer
Big oops on my part. The Randomart was looking a bit "same-y", and for a
good reason. The algorithm should be going in two-bit chunks at a time,
but I completely forgot to shift the bits over every time. This is added
now, huge mistake on my part whoopsie

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-06-03 10:08:36 -07:00
ae288b06df Add git add and ANSI output to gencommit.sh
Usually you want to `git add` when you run gencommit.sh, so that has
been added.

Also, add ANSI output because I like to see what we're generating while
in the terminal.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-05-31 22:26:39 -07:00
3071725d31 Rename hsl_colors -> hsl_palette
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-05-31 21:14:37 -07:00
28eca5e2de Remove StaticPalette class, redefine Palette type
StaticPalette was not really being used besides as a list wrapper, so
that is removed. Palette type is getting some use in the rest of the
codebase, so I have redefined that type as a Sequence[str], becauase
that's basically what it is.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-05-31 10:10:48 -07:00
7249ab3cff Add license
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-05-31 09:51:18 -07:00
7990c9ad6a Update README with a new "weaknesses" section and commit hash example
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-05-30 12:44:08 -07:00
2726f2d80f Add tools/gencommit.sh which will only generate the commithash SVG
This is useful so we aren't wasting cycles generating examples that
don't need to be generated and we just cut to the chase

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-05-30 12:35:38 -07:00
19578536aa Update commithash example to use nibbleart instead of randomart
I just like how it looks a little better

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-05-30 12:31:17 -07:00
5b5c2444db Add a new "rainbow-reverse" palette for randomart
This tries to add a bit more color distinction to the randomart
algorithm. As it so happens, half of the randomart examples got
converted to using the new palette, so that's a nice little win.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-05-30 12:27:27 -07:00
87af541cc4 Remove fullsource and use the current (previous) commit hash instead
Regenerating the fullsource hash was a bit tedious. Instead, it makes a
bit more sense to use the current commit hash as the header image. This
uses sha1 nibbleart.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-05-30 12:22:58 -07:00
1600c9874a Add fullsource.in, update fullsource examples
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-05-30 12:04:57 -07:00
30ed7ce21e Update SVG examples since a few things (dimensions, palette selection) have changed
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-05-30 11:51:47 -07:00
909306cd0c Remove old .svgs from the examples
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-05-23 11:17:03 -07:00
ed892b7630 Add all examples
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-05-22 10:58:39 -07:00
4d56302e1c Add a couple of examples
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-05-21 12:09:21 -07:00