Thanks to visit codestin.com
Credit goes to github.com

Skip to content

howto truncate values to a given range #1922

Closed
@ewelot

Description

@ewelot

I am trying to subtract two images and truncate the result to a given range, e.g. for 16bit integer images to 0 - 65535. The idea behind is that there is no negative signal/intensity in real images. I have tried subtract() and casting the result type but this would simply wrap negative values around the maximum value (like C does). What is the best way to achieve this? Maybe I have overlooked some simple libvips function which does the truncation?

Thanks for help,
Thomas

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions