fabricjs / fabric.js

Javascript Canvas Library, SVG-to-Canvas (& canvas-to-SVG) Parser
http://fabricjs.com
Other
28.02k stars 3.45k forks source link

[Feature]: fabircjs Exports tiff files #9910

Closed LingYun closed 3 weeks ago

LingYun commented 3 weeks ago

CheckList

Description

I want to export tiff files directly through fabricjs, does fabricjs currently support this?

Current State

Does fabricjs source code reserve extension space for exporting tiff files, can this be done on existing source code? The current idea is to convert from canvas to jpeg image format, and then from jpeg to tiff file format, I wonder if this idea is feasible?

Additional Context

No response

asturur commented 3 weeks ago

The browser do not support a TIFF file export. What you can do is pick up a library that supports TIFF encoding, export with toCanvaseElement, and use https://github.com/motiz88/canvas-to-tiff to create the TIFF. I think i used that one or another with success in the past.

Be aware that TIFF support, unless you need multipage files, is usually a unnecessary requirement. TIFF has nothing better than PNG when it comes to image quality at 8 bit per pixel.