Skip to content

Grayscale image isn't saved correctly for BMP format  #218

Open
@ehgus

Description

@ehgus

I discovered that a grayscale image is saved like a color image. I have compared the saved images from Julia and Matlab:

using Images
using FileIO

img = Gray.(rand(512,512));
save("image_julia.bmp",img);
img = rand(512,512);
imwrite(img,"image_matlab.bmp");

The result shows that Matlab represents an image as true grayscale, whereas Julia changes img to a colored view before saving. The image from Julia is obviously three times larger. Such unwanted behavior is not discovered in PNG format.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions