Git Product home page Git Product logo

piet-deformer's Introduction

Piet deformer

This is a tool to make piet programs matching a certain target image shape.

Currently the tool is really basic as it cannot yet handle branching (so no IFs nor loops), so for the time being we can only use it to encode/hide a fixed text messages. Nor it can cleverly select colors to match the input image. So the resulting color soup will be very suspicious for anyone who already knows of piet language. However it can provide fun forensic challenge for neophytes.

Also be aware that at the moment the modeler doesn't behave well on small text and/or sparse/thin masks (resulting in too small lines for the codels to fit in) as wou can see in the following images. So prefer long texts.

  • A piet code printing "Hello world. Bonjour le monde. Hallo welt. Hola mundo. Ciao mondo." (just "hello world" was really too short) with a heart shaped mask:
    Hello world piet code

  • A long text provide better results:

Usage

usage: ./src/piet_modeler.py [-h] [--invert-mask] [--output [OUTPUT]] [--message MESSAGE | --input_file INPUT_FILE] mask

Command line interface of the piet_modeler, an application to generate Piet programs matching the shape of an image

positional arguments:
  mask                  Path to the target shape image (currently support jpeg and png)

optional arguments:
  -h, --help            show this help message and exit
  --invert-mask         Invert the mask
  --output [OUTPUT], -o [OUTPUT]
                        Output filename
  --message MESSAGE, -m MESSAGE
                        Directly provide the text message to encode into a piet program
  --input_file INPUT_FILE, -f INPUT_FILE
                        Provide the text message to encode into a piet program via a ascii file

Roadmap

  • Generate image matching a basic target shape while encoding a given fixed message in piet.
  • Add post processing effects
  • Attempt to match colors of the target a little more using simple tricks.
  • Generate image matching more complex target shapes (ex: images with internal spaces, multiple blocs etc) using deformations methods other than the basic zigzag to get less "noisy" results.
  • Handle branching in the piet code.

piet-deformer's People

Contributors

kasonnara avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.