一个.TIFF JavaScript库 [英] A .tiff library for Javascript

查看:3077
本文介绍了一个.TIFF JavaScript库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有像一个图书馆 canvas2image (请看createBMP功能)为使得.TIFF在JavaScript中(或浏览器的NodeJS)?

Is there a library like canvas2image (please look at createBMP function) for making .tiff in JavaScript (browser or nodejs)?

推荐答案

有关TIFF文件原生浏览器的支持仍然是pretty坏。维基百科有关于浏览器图像格式支持一个很好的概述。

Native browser-support for tiff files is still pretty bad. Wikipedia has a nice overview regarding browser Image format support.

话虽这么说,因为.TIFF图像本质上仍然是一个光栅图像,人们确实可以将其转换(棘手的部分是这样的东西支持不同的COM pression-算法,如PACKBITS,DEFLATE,LZW等)到另一个(浏览器支持)光栅格式(因此一个可以养活它作为一个数据:IMG -source)。

That being said; since a .tiff image is still essentially a raster-image, one could indeed convert it (the tricky part is stuff like supporting different compression-algorithms like PACKBITS, DEFLATE, LZW, etc) to another (browser-supported) raster-format (so one could feed it as a data:img-source).

有一个叫库 Tiffus :一个客户端纯JavaScript图像库加载,保存和处理的二进制图像。

There is a library called Tiffus: a client side pure Javascript imaging library to load, save and manipulate binary images.

原始项目的目标是是创建一个普通的JavaScript浏览器扩展程序,可单/多页TIFF图像/秒转换为BMP / GIF图片(这是名字的由来)。

The original project aim was was to create a plain Javascript chrome extension which can convert single/multi page TIFF image/s to BMP/GIF image (this is where the name came from).

不过现在它支持:


  • 的Windows BMP(没有COM pression,RLE)

  • OS / 2 BMP

  • ICO

  • GIF

  • JPEG

  • PNG

  • TIFF

和目前支持folloing图像功能:

and currently supports the folloing image functions:


  • 负荷

  • 保存

  • 调整

  • 翻转

  • 变换颜色

基本上,它的工作原理是这样的:

Basically it works like this:


  1. 使用XMLHtt prequest与下载二进制数据源的图像
    Mime类型('text / plain的;字符集= X-用户自定义'); (未来:HTML5
    帆布的ImageData)

  2. 使用Tiffus图像处理

  3. 显示为数据URI方案
  4. 目标图像(未来:HTML5画布的ImageData)

这根据上述说明;笔者希望使用HTML5画布的ImageData 的未来。

Note that according to the above; the author expects to use HTML5 Canvas ImageData in the future.

希望这有助于!

这篇关于一个.TIFF JavaScript库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆