lovell / lovell/sharp

displace function similar to GM and jimp

Open
#1,737 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
JavaScript
Stars
32.7k
Forks
1.4k
Avg merge
1d 14h
Merged PRs (30d)
5

Description

I am working on a project in which I need to put graphics onto surfaces. To make the results look realistic I need the displace function using displacement map, similar to GM and Jimp displace() function.
The closest I found in the discussions here and there is about exposing vips mapim function but none come to a conclusion.
Implementation would look like:
1/use the vips_xyz to create the original index image from the destination image
2/modify the index image by a source image (a blurred grayscale version of the destination image) in which a white point would shift the point in the map a bit e.g. to top left, a black point would shift the point in the opposite direction e.g. to bottom right.
3/vips_mapim to apply the displacement to the destination image.
The API would look somewhat like:
sharp.displace(source_image,vertical_displacement, horizontal_displacement)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the proposed vips_xyz and vips_mapim flow and compare it with the displacement behavior described for GM and Jimp. Define how the source image and vertical and horizontal displacement values map to the proposed sharp.displace API. Done means the API applies the requested displacement map to the destination image with the described white and black point behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
computer-graphics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.