Giter Site home page Giter Site logo

photofill's Introduction

Photo Fill

A program to navigate and generate an infinite canvas of photos without using a grid

Live Preview

Instructions

Click and drag to navigate

Rectangles

Images

How it works

Perimeter is stored as an array of points in a clockwise order. This defines the shape simply and you can determine which direction is the inside by what is on the right side of the line (while traveling the array).

There are three rules for placing rectangles

  • Place anywhere on convex line
  • Concaves (corners) must be filled in the corner
  • Concaves from three lines (gulfs) must be filled first

Rules were created to avoid a girdlike view and to minimize scaling or stretching.

Notes

  • Currently slow performance once many squares are created.
    • One option to fix this is to remove squares that are far enough away
      • They could be kept in memory or deleted entirely depending on if persistance is wanted
  • There is an issue where once the offset is far enough and the direction changes, long strips of concave areas are created resulting in long columns or rows of rectangles.
    • This can be fixed by filling in more of the canves before loading the area but that solution is computationally expensive
  • Not written well for async
  • The algorithm for calculating points is inefficient
    • Entire perimeter is checked for errors when a value is added locally
    • Small optimizations could be made in multiple areas
      • Viewport fill checking
      • Potentially finding place to add next rectangle
  • Improvements could be made in:
    • Better fit insertions by selecting from batches
    • Updating viewport
      • Loop checks for any viewport movement
    • Package size
      • Library used is webpacked without code splitting
    • Using a packer to fill in concave areas
    • Algorithm for inserting a rectangle. Algorithm is weak
      • Requires a proper ordering of points
      • Points are inserted into perimeter and then require checking and removing inconsistencies

To Do

  • Write Tests
  • Convert implementation into a class
  • Convert to async
  • Accept photo feeds

Ideas

  • videos and gifs autoplay,
  • mouse over for sound,
  • tagging abilities,
  • clustering areas based on categories
  • 3d offsets or movment as a method of browsing

Resources for development

To Look At

Algorithms Used

photofill's People

Contributors

rafael09ed avatar

Watchers

 avatar  avatar

photofill's Issues

Large spaced out u-turns result in overlapping shapes

image

Non Guarantied steps to reproduce:

  1. Travel 5x canvas size in one direction,
  2. Turn right and travel 5x direction
  3. Repeat step #2 2 times.

usually appears after
image

Hard to reach bug because of lag. Documenting because there is an error in the algorithm implementation

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.