bugGNU Octave - Bugs: bug #62998, Hint SVG renderers to not...


bug #62998: Hint SVG renderers to not interpolate images

Submitter:  Pantxo Diribarne <pantxo>
Submitted:  Thu 01 Sep 2022 08:32:06 PM UTC
Category:  Plotting with OpenGL Severity:  1 - Wish
Priority:  5 - Normal Item Group:  Feature Request
Status:  Ready For Test Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * Any
* Mandatory Fields

Add a New Comment (Rich Markup)

Comment Type & Canned Response:


Thu 15 Sep 2022 07:36:21 PM UTC, comment #4: 

I pushed the patch here:


Marking ready for test.

Pantxo Diribarne <pantxo>
Project Member
Mon 05 Sep 2022 04:50:55 PM UTC, comment #3: 

I think there are two independent approaches which are using the SVG image element "image-rendering" property [1] or using its CSS replacement [2]. The current specification for SVG still lists the old possible values for "image-rendering" but says the following:

The CSS Image Values and Replacement Content Module Level 4 may in the future redefine this property. In particular it should allow the choice between smoothing and keeping a pixelated look when upscaling.

So AFAIU the first still does not supersede the second.

I'll push the patch with the SVG value ("optimzeSpeed") and hope that, as you say, it is actually interpreted as "cripEdges" (what we want) in modern viewers. 

[1] https://www.w3.org/TR/SVG/painting.html#ImageRenderingProperty
[2] http://dev.w3.org/csswg/css-images/#the-image-rendering

Pantxo Diribarne <pantxo>
Project Member
Fri 02 Sep 2022 09:28:57 AM UTC, comment #2: 

At first, I thought this was an odd name for what we want.
But reading what will probably be part of an updated standard, I agree that this is exactly what we'd probably want:

> This property previously accepted the values optimizeSpeed and optimizeQuality. These are now deprecated; a user agent must accept them as valid values but must treat them as having the same behavior as crisp-edges and smooth respectively, and authors must not use them.

IIUC, on renderers that support the newer standard, "optimizeSpeed" equates to "crisp-edges". That is what we want IIUC. And the keyword from the older standard is probably better supported by more renderers out there.
Not sure though what the last part of that section ("authors must not use them") refers to and how imperative it really is...

Nit: Small typo in the commit message "optimizedSpeed" -> "optimizeSpeed".

Looks good to me.

Markus M├╝tzel <mmuetzel>
Project Member
Thu 01 Sep 2022 08:37:18 PM UTC, comment #1: 

I attached a patch for octave-svgconvert.cc.

(file #53648)

Pantxo Diribarne <pantxo>
Project Member
Thu 01 Sep 2022 08:32:06 PM UTC, original submission:  

Currently Octave's SVG printout doesn't specify the "image-rendering" attribute for image elements [1] and thus rendering engines like Firefox and Inkscape pick the default value "auto" which interpolates images when scaling.

I checked that changing that value to "optmizedSpeed" disables interpolation at least again in Firefox and Inkscape. See the attached two SVG files.

[1] https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/image-rendering

Pantxo Diribarne <pantxo>
Project Member


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

Attach Files:

Attached Files
file #53648:  bug62998.patch added by pantxo (1KiB - text/x-patch)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by pantxo (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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-09-15 pantxo StatusPatch Reviewed Ready For Test
    2022-09-02 mmuetzel StatusPatch Submitted Patch Reviewed
    2022-09-01 pantxo Attached File- Added bug62998.patch, #53648
        StatusNone Patch Submitted

    Back to the top

    Powered by Savane 3.9