Collection of Go modules to supplement the stdlib image packages
401d24df — Blake Williams 4 months ago
imgconv: Image conversion functions
19bee027 — Blake Williams 4 months ago
testimg: Image compare functions
8f339096 — Blake Williams 4 months ago
Use unsafe.Slice for cast


browse  log 



You can also use your local clone with git send-email.

#imgx - Collection of Go modules to supplement the stdlib image packages

I've accumulated a lot of little tools for dealing with images since starting to play around with them in Go. Go's not the best language for this stuff performance-wise (it's actually a wee bit slow for some of the heavy lifting), but the ergonomics of the langauge seem to gel well with my overall set of preferences for writing code, so I persist with it in spite of the gaps, and have developed a number of helpers, tools and coping strategies (some of which are contained herein).

Each subfolder is its own Go module. This is an artifact of GitHub's lack of support for folder-based namespacing for repositories (which I would very much prefer to use for this).

No guarantees whatsoever are made about the stability of any APIs contained in this repo. If you require stability, it is strongly recommended that you copy and paste the required modules into your project's internal folder. They should be small and discrete enough, with minimal interdependencies.

Individual modules are separately licensed, but if there is no LICENSE file contained therein, the code is licensed under the LICENSE at the top-level.

#Probably incomplete list of modules:

  • imgconv: Image conversion functions to help avoid the uselessly slow standard library methods.
  • imggeom: Image geometry helpers. library methods.
  • rgba: Alternative image format to image.RGBA. I feel rgba produces more readable code with less array-index gymnastics. I use this as the basis for a lot of further processing, but perhaps I shouldn't've.
  • termpalette: Contains color.Palette instances for the 256-color terminal palette and the 16-color terminal palette using the widely used xterm formula.
  • testimg: Random image generation that I use a lot in testing.

#Expectation management

These are tools I hack on for my own amusement in an ad-hoc fashion. No stability guarantees are made, the code is not guaranteed to work, and anything may be changed, renamed or removed at any time as I see fit.

If you wish to use any of this, I strongly recommend you copy-paste pieces as-needed (including tests and license/attribution) into your own project, or fork it for your own purposes.

Bug reports are welcome, feature requests discouraged, and code contributions will not be accepted.