Code Monkey home page Code Monkey logo

Comments (2)

nuno-faria avatar nuno-faria commented on May 17, 2024 1

Hello. I don't remember the exact configurations but here are some approximations:

If you want to build images with dynamic shapes and sizes, it is better to provide a relatively small PIXEL_SHIFT and multiple RESIZING_SCALES.
For example, to build the cake with the dynamic circles:

# config (everything else uses the default values)
RESIZING_SCALES = [1, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1]
PIXEL_SHIFT = (5, 5)
# command
python .\tiler.py .\cake.png .\tiles\circles\gen_circle_100\

cake-circles-dynamic

Or to build the cake with the paper clips:

RESIZING_SCALES = [1, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1]
PIXEL_SHIFT = (5, 5)
python .\tiler.py .\cake.png .\tiles\clips\gen_clip\

imagem

If you instead want images with grid-like tiles (e.g., lego tiles), just use a single value for the RESIZING_SCALES and set PIXEL_SHIFT to None.
For example, to build the cake with the fixed circles:

RESIZING_SCALES = [0.1] # each circle will be 10x10, since 0.1 * 100x100 = 10x10
PIXEL_SHIFT = None # each shift will be the size of the image, i.e., 10x10
python .\tiler.py .\cake.png .\tiles\circles\gen_circle_100\

imagem

Likewise, to build the cake with a cross-stitch pattern:

RESIZING_SCALES = [0.1]
PIXEL_SHIFT = None
python .\tiler.py cake.png .\tiles\times\gen_times\

imagem

All examples provided in the README use either one or the other technique, except for the striped cake. To build that, we just need to provide small lines (tiles/lines/gen_line_h/) and a wide PIXEL_SHIFT on the x axis.

RESIZING_SCALES = [0.16]
PIXEL_SHIFT = (30, 1)
python .\tiler.py cake.png .\tiles\lines\gen_line_h\

imagem

Hope this helps.

from tiler.

vba34520 avatar vba34520 commented on May 17, 2024

Thank you very much for your reply, best wishes!

from tiler.

Related Issues (20)

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.