sharp icon indicating copy to clipboard operation
sharp copied to clipboard

Support in Sharp for pixelwise arithmetic operations

Open zigabostner opened this issue 1 year ago • 3 comments

Pixelwise arithmetic operations currently don't seem to be provided through the Sharp API even though libvips does implement them. Is this correct? Is there maybe any intention or plan to expose these operations also through Sharp at some point?

zigabostner avatar Nov 08 '22 13:11 zigabostner

Does the linear() operation, which allows for pixel arithmetic, provide what you need?

https://sharp.pixelplumbing.com/api-operation#linear

If not, was there a specific operation you were looking for?

lovell avatar Nov 08 '22 14:11 lovell

Ideally, I would like to be able to use the following operations: (from https://www.libvips.org/API/current/libvips-arithmetic.html)

vips_add
vips_subtract
vips_multiply
vips_divide
vips_sign
vips_sin
vips_cos
vips_atan2
vips_pow
vips_relational
vips_relational_const

zigabostner avatar Nov 08 '22 17:11 zigabostner

Thanks, I'll tag this as a future possible enhancement.

lovell avatar Nov 14 '22 09:11 lovell