tiff

How to display TIFF (in form of Byte[]) on Silverlight Image control

天涯浪子 提交于 2019-12-04 07:55:13
I created a window service to put all of my TIFF files into database and stored them as Byte[] . Now I want to be able to display them through Silverlight Image control So i use the Converter during binding XAML in order to convert the Byte[] to Bitmap because the Image.Source only accept eitheir URI (I don't have the file stored on server so can't use this method) or Bitmap . BitmapImage bmi = new BitmapImage(); if (value != null) { ImageGallery imageGallery = value as ImageGallery; byte[] imageContent = imageGallery.ImageContent; string imageType = imageGallery.ImageType; using (MemoryStream

numpy.array of an “I;16” Image file

情到浓时终转凉″ 提交于 2019-12-04 06:49:37
I want to use TIFF images to effectively save large arrays of measurement data. With setting them to mode="I;16" (corresponding to my 16 bit data range), they yield 2MB files (~1000x1000 "pixel"). Which is good. However I am having troubles reconverting them into arrays when it comes to analysing them. For 32bit data (-> "I") the numpy.array command works fine. In case of "I;16" the result is a 0D numpy array with the TIFF as the [0,0] entry. Is there a way to get that to work? I would really like to avoid using 32bit images, as I don't need the range and it doubles the HDD space required

Extract JPEG from TIFF file

℡╲_俬逩灬. 提交于 2019-12-04 06:43:29
Background I have a large TIFF file that is compressed with JPEG (new, compression 7 in TIFF standard) and is tiled. What I need to do is extract these tiles to individual .jpg files. I need to be able to do this with out decompressing/recompressing the image data because that will require too much compute resources, so all libraries that I know of are out of the question. I know a lot about TIFF file structure, but almost nothing about JPEG file structure. I have code written right now that reads the JPEGTable tag data from the tiff header into a byte array (meaning it goes to the offset

Reading tiff image metadata in Python

霸气de小男生 提交于 2019-12-04 06:37:28
How can I read metada, like coordinates, from a TIFF image in Python? I tried foo._getexif() from PIL, but got the message: AttributeError: 'TiffImageFile' object has no attribute '_getexif' Is it possible to get it with PIL? from PIL import Image from PIL.TiffTags import TAGS with Image.open('image.tif') as img: meta_dict = {TAGS[key] : img.tag[key] for key in img.tag.iterkeys()} _getexif() is only meant to be used with JPEG. JPEG requires unpacking of the metadata, TIFF does not. That said, PIL does not naively read Exif tags or directory (less straightforward) TIFF metadata. ExifRead will

how to convert dzi files to multi-tile pyramidal tiff format

你说的曾经没有我的故事 提交于 2019-12-04 05:58:38
问题 In reference to the answer (how to convert dzi (deep zoom) files to full image) I am a noob on this topic, please correct if I am wrong. I am trying to create a multi-tiled tiff from .dzi (deep zoom image) format, how I am doing is: (i) Pick the max level folder. (ii) Vertically Stitch all the n columns of m rows (m_n.jpeg, I am referring to the images saved in this format) as png images. So they are occupying quite a considerable amount of space. (iii) Finally, I horizontally merge all these

ImageMagick or GhostScript: convert a multi-page TIFF to a multi-page PDF

折月煮酒 提交于 2019-12-04 05:04:28
I need to convert a multi-page TIFF to a multi-page PDF. I have access to ImageMagick and GhostScript (in *nix environment). How do I do this? Thanks. UPDATE: It turns out that my test file was wrong (it didn't have multiple pages), which made me think my command was wrong. This seems to work for me: convert input.tif output.pdf Use a tool called tiff2ps from the tool set provided by libtiff: http://www.libtiff.org/tools.html Once you have the tiff in ps format, you can call ps2pdf to convert to pdf, which is part of the ghostscript package in most linux distributions. convert multipage.tiff

Jpeg from Tiff (jpeg-compressed)

霸气de小男生 提交于 2019-12-04 04:16:38
How can i extract image from JPEG-compressed TIFF file ? I've read bytes according to StripOffests and StripBytesCount fields, but i couldn't load an image from them. Old style TIFF-JPEG (compression type 6) basically stuffed a normal JFIF file inside of a TIFF wrapper. The newer style TIFF-JPEG (compression type 7) allows the JPEG table data (Huffman, quantization), to be stored in a separate tag (0x015B JPEGTables). This allows you to put strips of JPEG data with SOI/EOI markers in the file without having to repeat the Huffman and Quantization tables. This is probably what you're seeing with

Save raw data as tif

爱⌒轻易说出口 提交于 2019-12-04 04:07:54
问题 I need to analyze a part of an image, selected as a submatrix, in a tif file. I would like to have the image in raw format, with no frills (scaling, axis, labels and so on)... How could I do that? This is the code I am using now: submatrix = im[x_min:x_max, y_min:y_max] plt.imshow(submatrix) plt.savefig("subplot_%03i_%03i.tif" % (index, peak_number), format = "tif") 回答1: First off, if you're just wanting to store the raw values or a grayscale representation of the raw values, it's easiest to

Python PIL struggles with uncompressed 16-bit TIFF images

一曲冷凌霜 提交于 2019-12-04 03:39:52
My system is Mac OS X v10.8.2. I have several 2560x500 uncompressed 16-bit TIFF images (grayscale, unsigned 16-bit integers). I first attempt to load them using PIL (installed via Homebrew, version 1.7.8): from PIL import Image import numpy as np filename = 'Rocks_2ptCal_750KHz_20ms_1ma_120KV_2013-03-06_20-02-12.tif' img = Image.open(filename) # >>> img # <PIL.TiffImagePlugin.TiffImageFile image mode=I;16B size=2560x500 at 0x10A383C68> img.show() # almost all pixels displayed as white. Not correct. # MatLab, EZ-draw, even Mac Preview show correct images in grayscale. imgdata = list(img.getdata

Tensorflow Machine Learning: No Decoder for TIFF Images?

烈酒焚心 提交于 2019-12-04 01:22:40
问题 I have noticed the Tensorflow Python package provides standard procedures for decoding jpeg , png and gif images after reading files. For instance for png : import tensorflow as tf filename_queue = tf.train.string_input_producer(['/Image.png']) # list of files to read reader = tf.WholeFileReader() key, value = reader.read(filename_queue) decoded_image = tf.image.decode_png(value) # use png or jpg decoder based on your files. However, the tiff format decoder seems to be missing. So what