Git Product home page Git Product logo

mosaic's Introduction

mosaic

Photo mosaic algorithm implementation in pure JS. A photomosaic, is a digital image that is made up of other digital images, pieced together by software. Photomosaics are generally credited to Robert Silvers, who developed the technique while he was a student at MIT. Main algorithm was picked here.

how to run

Prepare a folder with jpg images (in our example it's called imgs) in this format nXXX.jpg. Where XXX it's an image index number starting from 0. For example: n0.jpg, n1.jpg and so on. We will use them as a source images to build the final (big) picture. Find as many images as you can, because it affects the final picture quality. Install dependencies and run local http-server with imgs folder as a parameter. Don't forget to add --cors parameter in the end. Run the mosaic app and go to your browser URL localhost:port and you will see this simple UI:

image

Cell width & height means the size of one cell (picture will be split into cells) on a final picture, where our app will put one of the source images, which fits best. The URL means a URL of the final picture, made up of other images. Generate button runs the process. Download button downloads final picture into the png file.

npm i - to install dependencies
npx http-server ./imgs --cors to run local server with images
npm run start - to run mosaic in a dev mode
npm run build - to build mosaic in production

screenshot

mosaic-me12x12

mosaic's People

Contributors

tmptrash avatar

Watchers

 avatar  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.