tiff

View a multipage TIFF in Javascript

余生长醉 提交于 2019-12-23 09:37:42
问题 I currently have multi-paged TIFF images and I need to browse them page by page via Javascript. I have no clue about that. Can you help me? I found some other questions but none seems related to Javascript. Thank you. 回答1: I very much doubt JavaScript can help you here: Most browsers can't deal with TIFF images in the first place, let alone multi-page ones. You will need the help of server-side scripting - like PHP - in combination with a tool like ImageMagick. I've never tried this myself,

Having an image file buffer in memory, what is the fastest way to create its thumbnail?

拜拜、爱过 提交于 2019-12-23 08:44:30
问题 Trying to create a an image acquiring application optimized for a fast scanner (which can provide up to 6 compressed images [color+gray+binary][front+rear] for each paper at speed of 150 ppm) I have some speed issues. Using TWAIN technology and memory buffer transfer mode (TWSX_MEMORY) I receive image buffer (as JPEG or TIFF file loaded in memory) from scanner and save it to my application destination path. If I do not want to create thumbnails, my application causes no speed loss for the

fseek to a 32-bit unsigned offset

可紊 提交于 2019-12-23 03:12:28
问题 I am reading a file format (TIFF) that has 32-bit unsigned offsets from the beginning of the file. Unfortunately the prototype for fseek, the usual way I would go to particular file offset, is: int fseek ( FILE * stream, long int offset, int origin ); so the offset is signed. How should I handle this situation? Should I be using a different function for seeking? 回答1: You can try to use lseek64() (man page) #define _LARGEFILE64_SOURCE /* See feature_test_macros(7) */ #include <sys/types.h>

Simplest way to save array into raster file in Python

为君一笑 提交于 2019-12-23 02:34:31
问题 With one 2-d array in the shape of (100, 100), I want to save it into raster file in .tiff format. I can use gdal package to read tiff files which are already exist. But I still can't find a simple way to transform the 2-d array into tiff file . Using plt.imsave("xx.tif",array) or def array_to_raster(array): """Array > Raster Save a raster from a C order array. :param array: ndarray """ dst_filename = 'xxx.tiff' x_pixels = 100 # number of pixels in x y_pixels = 100 # number of pixels in y

Opencv: Why does the file size change when I read and write an image without making any changes?

耗尽温柔 提交于 2019-12-22 23:54:34
问题 I have a list of (.TIFF) files which I am renaming and saving in the same format. I am using cv2 module to do this. import cv2 import os import glob os.chdir('C:/99_Temp/') for file in glob.glob("*.tiff"): f = os.path.splitext(file) time_val = f[0][:2] a1 = cv2.imread(file) cv2.imwrite(time_val+'.tiff',a1) Why are the file sizes reduced from the original TIFF file? I haven't done any processing and visually the images look the same. But I am wondering, why the difference? 回答1: There could be

How to specify colormap when saving tiff stack

此生再无相见时 提交于 2019-12-22 13:50:03
问题 I'm using tifffile in python to save out 3-channel tiff stacks, which I then want to read into ImageJ or FIJI. These tiff stacks open as composites in ImageJ with each channel assigned a (presumably default) colormap/LUT. However, the colors that are assigned aren't the colors that make sense for my images. My problem is that I can't figure out how to specify the colormap for each channel when saving the image using tifffile . For example, I'd like to have the following colormap assignments:

Converting 24BPP to 4BPP with GDI+ in VB.NET

依然范特西╮ 提交于 2019-12-22 12:57:21
问题 My VB.NET program currently takes a 4BPP TIFF as an Bitmap, converts it to a Graphic, adds some text strings and then saves it out again as a TIFF file. The output Bitmap.Save() TIFF file by default seems to be 24BPP (regardless of the input) and is a lot larger than the original TIFF. Is it possible to keep the same 4BPP palette encoding as the input for the output and if not, how can I convert my Bitmap PixelFormat from 24BPP to 4BPP Indexed. I've seen an example for converting 24 BPP to 1

How to embed a small image on top of another image and save it using JavaScript?

橙三吉。 提交于 2019-12-22 09:55:12
问题 I have a large image tif format and two small images. What I wanted to achieve is that I want to embed either of the two small images on top of a large image and save it using JavaScript. <html> <body> <img src="largeimg" /> <p>Select the image to embed on the large image</p> <img src="smallimg1" /> <img src="smallimg2" /> </body> </html> Is there any way to achieve the above using javascript? 回答1: If the images are on the same origin the it is possible to use canvas. draw images to canvas

Automatic saving a figure as an image file in Matlab

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-22 08:38:47
问题 I'm creating 49 figures in Matlab, they are all created automatically one after the other. I want them to also automatically be saved as .tif or .jpg images with names corresponding to their figure number. Can I do it? And if so,how? the code for the creation of the figures is: for num_picture=0:48 ... figure (num_picture+1) imshow (screen_im) end The ... part is where all the calculations of screen_im are. I want those images in order to create a movie from them, If there is a way where I

Convert TIFF LZW to CCITT

微笑、不失礼 提交于 2019-12-22 08:12:47
问题 This is a question about TIFF and compression. I have hundreds of LZW compressed tiff images. I wonder, is it possible to convert those to CCITT T.6? Is there some API? Please help. 回答1: LZW compression can be used to compress almost any image. CCITT T.6 can compress only bilevel (black and white) images. If your images are bilevel ones and they are compressed with LZW compression then you can recompress them using tiffcp utility (comes with LibTiff.Net library, free, source code available).