pixelated-avatar-generator

A library and application for generating pixelated avatars.

https://github.com/ExcaliburZero/pixelated-avatar-generator

Version on this page:0.1.2
LTS Haskell 11.22:0.1.3
Stackage Nightly 2018-03-12:0.1.3
Latest on Hackage:0.1.3

See all snapshots pixelated-avatar-generator appears in

MIT licensed by Christopher Wells
Maintained by [email protected]
This version can be pinned in stack with:pixelated-avatar-generator-0.1.2@sha256:b7073d2dd3e32055424423dcbb633c2bce556a1c01cddeb6887b822c4ab3d4bd,3262

Module documentation for 0.1.2

Pixelated Avatar Generator Travis CI Status Coverage Status

Pixelated Avatar Generator is a Haskell library and application for generating pixelated avatar images from seed values.

import Graphics.Avatars.Pixelated

createAndSaveAvatar :: String -> FilePath -> IO ()
createAndSaveAvatar s path = saveAvatar avatar path
  where avatar = scaleAvatar 32 $ generateAvatar seed
        seed   = createSeed s

Some examples of avatars generated by the library.

Library

Pixelated Avatar Generator is a library which provides functions and data types for generating, altering, and saving pixelated avatars.

For information on how to use the library, see the documentation for the Graphics.Avatars.Pixelated module.

Documentation

The documentation for the latest release of the library can be found in the library’s Hackage entry.

Documentation of the development versions of the library can be generated by running the following command in the main directory of the project:

$ stack haddock

The generated html documentation can then be found in the following directory:

.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/doc

Executable

An example executable program that uses the library is also provided. It creates an avatar from a given seed string and saves the created .png image to a given file location.

The executable can be compiled by running the following command:

$ stack build

The executable can then by run by running it with stack exec and providing it the desired filepath of the output file including the .png extension and a random seed string.

$ stack exec pixelated-avatar-generator image.png "Hello, World"
Creating avatar at image.png
Grey
█ ████ █
        
  ████  
█  ██  █
████████
█ █  █ █
█      █
████████
Successfully created avatar, and saved it to image.png

Usage

Usage: pixelated-avatar-generator FILEPATH SEEDSTRING

FILEPATH   -- The location to save the generated avatar at. "img/test.png"
SEEDSTRING -- The string to use to generate the avatar. "Hello"

Links

License

The source code of Pixelated Avatar Generator is available under the MIT license, see LICENSE for more information.

Changes

Changelog

0.1.2

  • Add missing test files to Cabal config, to allow tests to pass from Hackage package.

0.1.1

  • Implement saving with different image formats.
  • Add image format conversion functions for PNG, GIF, and TIFF.
  • Change the example image in the readme file.
  • Add a link to the Hackage package to the readme file.
  • Document the process of making a release of the package.
  • Add information on the library to the readme file.
  • Improve the documentation of the library.
  • Improve some of the avatar colors.

0.1.0

  • Implement generation and saving of avatars.
  • Implement avatar upscaling.
  • Create example executable program that makes use of the library.