Skip to content
This repository was archived by the owner on Aug 27, 2026. It is now read-only.
This repository was archived by the owner on Aug 27, 2026. It is now read-only.

Alternatives to Batik for scaling images #9

Closed

Description

@etpinard

#6 tries to replace the batik svg to pdf converter with electron's printToPDF. At first glance, things are looking good on that front (ref #6 (comment)),

But, the old image server also uses batik to scale images (from a plotly svg to a scaled png). This gist compares the batik converter with two other node.js libraries (sharp and gm) and a browser-side solution.

The browser-side solution is looking good. It uses context.drawImage's width/height options for png/jpeg/webp formats and viewBox for SVGs.

Can anyone think of possible limitations for the browser-side solution?

Activity

  1. alexcjohnson commented on Aug 31, 2017

    @alexcjohnson
    Collaborator

    I can't think of any problems, and if anything I think browser-side should allow us to do better with the crispEdges issues #6 (comment) as it can apply crisp rendering after the image is already scaled up.

  2. etpinard commented on Sep 1, 2017

    @etpinard
    ContributorAuthor
  3. etpinard commented on Sep 1, 2017

    @etpinard
    ContributorAuthor

    Closing. This will be done in plotly/plotly.js#1979 and released as part of plotly.js 1.31.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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