# IPCV - please update help page for imread

**URL:** <https://scilab.discourse.group/t/ipcv-please-update-help-page-for-imread/1103>\
**Category:** Atoms packages\
**Created:** [December 27, 2025, 11:51pm UTC](https://scilab.discourse.group/t/ipcv-please-update-help-page-for-imread/1103 "2025-12-27T23:51:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![philipp](https://yyz2.discourse-cdn.com/free1/user_avatar/scilab.discourse.group/philipp/32/53_2.png) [@philipp](https://scilab.discourse.group/u/philipp)\
**Post date:** [December 27, 2025, 11:51pm UTC](https://scilab.discourse.group/t/ipcv-please-update-help-page-for-imread/1103/1 "2025-12-27T23:51:20Z")

</div>

Hello,

out of curiousity installing Scilab 2026 and the latest IPCV version I find that the help page for `imread` might benefit from a small update.

Especially the use of the different modes.

Current help page:

> modes: imread mode to be specified for different image format

Just later down it is mentioned:

> The imread mode can be controlled by setting any of these optional arguments to 1:

I wonder if it could be possible to move this information to the “modes” section.

Thats aside, it took me while a while to figure out that the optional argument `IMREAD_ANYDEPTH`

can be set not only to `1` (grayscale), but also `3` (RGB), `4` (RGBA).

This is not mentioned in the help page at all.

Indeed `2` is also possible, but it seem to give the same result as `3`…in fact it seems that all integers are possible, even negative ones … `-1` creates the same result as `4`. Funny enough`IMREAD_ANYDEPTH= 10000` reduces the image size from 256x256 to 64x64

To play around with the settings, I use this script:

```auto
img = imread(fullpath(getIPCVpath()+"/images/puffin.png"),IMREAD_ANYDEPTH = 4);
[H W CH] = size(img)

f = figure();
f.figure_position = [20,20];
f.background = 8;           

if(CH == 1)
    f.figure_size = [400,411]
    imshow(img);
    a = gca();
    a.x_label.text = "image";
else
    f.figure_size = [1500,411];
    
    subplot(1,CH+1,1)
    imshow(img);
    a = gca();
    a.x_label.text = "image";

    subplot(1,CH+1,2)
    imshow(img(:,:,1));
    a = gca();
    a.x_label.text = "R";

    subplot(1,CH+1,3)
    imshow(img(:,:,2));
    a = gca();
    a.x_label.text = "G";

    subplot(1,CH+1,4)
    imshow(img(:,:,3));
    a = gca();
    a.x_label.text = "B";

    if(CH==4)
        subplot(1,CH+1,5)
        imshow(img(:,:,4));
        a = gca();
        a.x_label.text = "A"
    end

end

```

Cheers, Philipp

---

<div class="post-metadata">

**Author:** ![mottelet](https://yyz2.discourse-cdn.com/free1/user_avatar/scilab.discourse.group/mottelet/32/13_2.png) [@mottelet](https://scilab.discourse.group/u/mottelet)\
**Post date:** [January 5, 2026, 9:04am UTC](https://scilab.discourse.group/t/ipcv-please-update-help-page-for-imread/1103/2 "2026-01-05T09:04:42Z")

</div>

Hello,

You can open a PR at [GitHub - tanchinluh/IPCV: Scilab Image Processing and Computer Vision Module](https://github.com/tanchinluh/IPCV/) with your doc updates.

S.

---

<div class="post-metadata">

**Author:** ![philipp](https://yyz2.discourse-cdn.com/free1/user_avatar/scilab.discourse.group/philipp/32/53_2.png) [@philipp](https://scilab.discourse.group/u/philipp)\
**Post date:** [January 5, 2026, 10:55am UTC](https://scilab.discourse.group/t/ipcv-please-update-help-page-for-imread/1103/3 "2026-01-05T10:55:01Z")

</div>

Hello,

I do understand that GitHub is the place for distributed/shared coding, but I am not familiar with this platform.

I figure`PR` stands for `pull request` but how would I do this?

Do I need to create a `fork`?

If yes, from which version?

Would you like to have a direct change in `imread.xml` ?

Thank you,

Philipp

---

<div class="post-metadata">

**Author:** ![mottelet](https://yyz2.discourse-cdn.com/free1/user_avatar/scilab.discourse.group/mottelet/32/13_2.png) [@mottelet](https://scilab.discourse.group/u/mottelet)\
**Post date:** [January 5, 2026, 3:33pm UTC](https://scilab.discourse.group/t/ipcv-please-update-help-page-for-imread/1103/4 "2026-01-05T15:33:32Z")

</div>

You can directly edit the file [IPCV/help/en\_US/Image Reading, Display and Exploration/imread.xml at master · tanchinluh/IPCV · GitHub](https://github.com/tanchinluh/IPCV/blob/master/help/en_US/Image%20Reading%2C%20Display%20and%20Exploration/imread.xml), a fork will be created on-the-fly.

S.

---

<div class="post-metadata">

**Author:** ![mottelet](https://yyz2.discourse-cdn.com/free1/user_avatar/scilab.discourse.group/mottelet/32/13_2.png) [@mottelet](https://scilab.discourse.group/u/mottelet)\
**Post date:** [January 5, 2026, 4:05pm UTC](https://scilab.discourse.group/t/ipcv-please-update-help-page-for-imread/1103/5 "2026-01-05T16:05:54Z")

</div>

However, I think that imread.xml on master branch does not need any fix, the optional arguments should only take value 1, hence you don’t have to play with other values. Loading the image as RGBA (if alpha channel does exists) is triggered by `IMREAD_UNCHANGED=1` (see below):

```auto
   <para>
The imread mode can be controlled by setting any of these optional arguments to 1:
   </para>
   <para>
IMREAD_UNCHANGED (return the loaded image as is (with alpha channel, otherwise it gets cropped). Ignore EXIF orientation)
   </para>
   <para>
IMREAD_GRAYSCALE (convert image to the single channel grayscale image)
   </para>
   <para>
IMREAD_COLOR (convert image to the 3 channel color image)
   </para>
   <para>
IMREAD_ANYDEPTH (return 16-bit/32-bit image when the input has the corresponding depth, otherwise convert it to 8-bit)
   </para>
...

```

---

<div class="post-metadata">

**Author:** ![philipp](https://yyz2.discourse-cdn.com/free1/user_avatar/scilab.discourse.group/philipp/32/53_2.png) [@philipp](https://scilab.discourse.group/u/philipp)\
**Post date:** [January 7, 2026, 2:38pm UTC](https://scilab.discourse.group/t/ipcv-please-update-help-page-for-imread/1103/6 "2026-01-07T14:38:52Z")

</div>

> … the optional arguments should only take value 1 …

I guess this is true for most optional arguments, since I did not play around will all of them.

However here is a counter example: IMREAD\_ANYDEPTH

> img = imread(fullpath(getIPCVpath()+“/images/puffin.png”),IMREAD\_ANYDEPTH = 1);

size(img) –\> 256 x 256 matrix // grayscale image

> img = imread(fullpath(getIPCVpath()+“/images/puffin.png”),IMREAD\_ANYDEPTH = 3);

size(img) –\> 256 x 256 x 3 matrix // RGB image

> img = imread(fullpath(getIPCVpath()+“/images/puffin.png”),IMREAD\_ANYDEPTH = 4);

size(img) –\> 256 x 256 x 4 matrix // RGBA image

Note: puffin.png is a 32 bit image

So, to load the image using `IMREAD_ANYDEPTH` one would have to use `IMREAD_ANYDEPTH = 4` to get all image channels.

Also: Since IPCV depends on openCV, **I guess** the functionality is inherited from openCV.

(e.g.: IPCV mimics openCV one-to-one)

Having a look at

> **[OpenCV: Flags used for image file reading and writing](https://docs.opencv.org/3.4/d8/d6a/group __imgcodecs__ flags.html)**

it seems that a lot of flags can differ from “1”.

Furthermore the doc-page states:

> IMREAD\_ANYDEPTH (return 16-bit/32-bit image when the input has the corresponding depth, otherwise convert it to 8-bit)

That’s exactly what the openCV help mentions, however:

Isn’t it either 8, 24 or 32 bit … 8 bit / channel?

All the best,

Philipp
