displace function similar to GM and jimp
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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