Skip to content

[PROTOTYPE] tool that processes multiple images to create a dynamic viewing experience, where the image changes as the viewer's angle shifts

Notifications You must be signed in to change notification settings

S1D007/Lenticular-Proto

Repository files navigation

Lenticular Image Interlacing Software

This Go server allows you to upload multiple images and interlace them for lenticular printing. The server uses the Gorilla Mux router and the disintegration/imaging package for image processing.

Input Image 1 Input Image 2 Input Image 3 Input Image 4

Result Image

Features

  • Upload multiple images
  • Interlace images based on a specified strip width
  • Returns the interlaced image as a PNG

Prerequisites

  • Go (version 1.16 or higher)
  • Git (to clone the repository)

Installation

  1. Clone the repository:

    git clone https://github.com/S1D007/Lenticular-Proto.git
    cd Lenticular-Proto
  2. Install dependencies:

    Use the following command to install the required packages:

    go get -u github.com/gorilla/mux
    go get -u github.com/disintegration/imaging
  3. Run the server:

    Start the server by running:

    go run main.go

    The server will start on http://localhost:8081.

API Endpoint

POST /upload

This endpoint allows you to upload images and specify the strip width for interlacing.

Request Parameters:

  • images: One or more images to be interlaced (multipart form data).
  • stripWidth: (Optional) A float representing the width of the strips for interlacing. If not provided, defaults to 8.0.

Example Request Using curl:

curl -X POST -F "images=@path_to_image1.jpg" -F "images=@path_to_image2.jpg" -F "stripWidth=10.5" http://localhost:8081/upload

Response:

  • On success: The interlaced image will be returned as a PNG.
  • On error: A JSON response with an error message will be returned.

Example Error Response:

{
  "error": "Unable to parse form"
}

Acknowledgments

About

[PROTOTYPE] tool that processes multiple images to create a dynamic viewing experience, where the image changes as the viewer's angle shifts

Topics

Resources

Stars

Watchers

Forks