Skip to content

colour_transform_to Image_type.GREY16 leaves image as 32bit float #83

Open
@indridieinarsson

Description

@indridieinarsson

I've been writing some scripts in the nip2 scripting language to deal with b&w film scans. Those are in 16bit greyscale.
I load it into a nip2 workspace, nip2 says it is "3424x2320 16bit unsigned integer, 1 band, GREY16"

Then I run it through a toolkit I wrote, which does some manipulation (gamma + scaling), which is inherently a floating point operation, so no surprise that the results of that nip2 cell says the image is now: "3424x2320 32bit float, 1 band, GREY16"

However, this is problematic since some of nip2 tools don't work properly on 32bit float images.

In my script, I tried to do conversion : value = colour_transform_to Image_type.GREY16 value2; where value2 is the manipulated image as before (I did reload the script in the meantime). This conversion does not seem to change anything, as the type of the image in the nip2 cell is still declared as "3424x2320 32bit float, 1 band, GREY16".

I also tried to do casts, which also brought nothing.

Is there a bug in the color_transform_to function, or (more likely) am I misunderstanding something here? I'm using nip2 v 8.7.1 compiled against libvips 8.8.3 on a linux machine.

Greetings,
Indriði

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions