bugGNU Octave - Bugs: bug #41768, imdither() calls imwrite() in the...


bug #41768: imdither() calls imwrite() in the wrong way (Package: image)

Submitter:  None
Submitted:  Mon 03 Mar 2014 04:48:51 PM UTC
Category:  Octave Forge Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Wont Fix Assigned to:  None
Originator Name:  Gabriel Schumann Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 4.2.0
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

Wed 12 Apr 2017 12:51:34 PM UTC, comment #3: 

I have removed the function imdither from the image package.

Fixing this issue properly would require a rewrite of a function.  However, if that happens, the missing function dither should be implemented instead.  That is a missing function in Octave core that should do exactly what imdither was meant to do before.


Carnë Draug <carandraug>
Group Member
Thu 15 Dec 2016 12:34:16 PM UTC, comment #2: 

This issue is still present in Octave 4.2.0 with image 2.6.1.

(The imdither function still does not work, e.g. with the short example from comment #0.)

Hartmut <hardy>
Mon 03 Mar 2014 06:22:30 PM UTC, comment #1: 

The problem was that imdither was using some undocumented features of imwrite. Those features were removed in 3.8.0 or we couldn't keep Matlab compatibility. I'd guess that imdither should never be using those features in the first place.

Simply changing the order of the filename and image matrix won't fix it.

A possibility to fix this was once implemented in rgb2ind. See http://hg.savannah.gnu.org/hgweb/octave/rev/5d6243c2acbf#l1.133 That change was later reverted because see bug #40669 .

Also, graphicsmagick does some funny things when the filename has certain strings. It may be possible to do also do this by trying to mix theses options with the filename.

If you can prepare a modified to imdither (with his suggested change or something else) that works I will happily make the change to fix this regression.

Carnë Draug <carandraug>
Group Member
Mon 03 Mar 2014 04:48:51 PM UTC, original submission:  

Calling imdither() on an image results in the following error:

error: Invalid call to imwrite.  Correct usage is:

in 3.6.4 on Debian Jessie or

error: imwrite: no FILENAME specified

in 3.8.0 on Windows.

Code, which results in an error as explained above:

img = imread('colpeppers.jpg');
[img2,map] = imdither(img,256);



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Updated the item)
  • -email is unavailable- added by hardy (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only project members can vote.


    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-04-12 carandraug StatusNone Wont Fix
        Open/ClosedOpen Closed
    2016-12-15 mmuetzel Release3.8.0 4.2.0

    Back to the top

    Powered by Savane 3.12