tiff

Cannot view tiff images in Kivy

时光毁灭记忆、已成空白 提交于 2019-12-10 20:06:24
问题 problem I am able to load pictures with the Image() module in kivy. But for some reason, I can't load .tif files into kivy. When the image source is '..\pics\lugia.png' , the image loads perfectly fine. But if the source is '..\pics\snorlax.tif' , I just get that white box and the error: [WARNING] [Image ] Unable to load image <C:\Users\path\pics\snorlax.tif> [ERROR ] [Image ] Error loading texture ..\pics\snorlax.tif code from kivy.app import App from kivy.uix.boxlayout import BoxLayout from

System.Drawing.Image.Save throws ExternalException: A generic error occurred in GDI

你离开我真会死。 提交于 2019-12-10 17:17:03
问题 I have function which takes a bitmap, copies part of it and saves it as 8bpp tiff. Filename of the result image is unique and file doesn't exist, program has permission to write to the target folder. void CropImage(Bitmap map) { Bitmap croped = new Bitmap(200, 50); using (Graphics g = Graphics.FromImage(croped)) { g.DrawImage(map, new Rectangle(0, 0, 200, 50), ...); } var encoderParams = new EncoderParameters(2); encoderParams.Param[0] = new EncoderParameter(System.Drawing.Imaging.Encoder

How to grab a TIFF image from python

一曲冷凌霜 提交于 2019-12-10 15:13:33
问题 Today I'm in trouble because for the first time I have to work with TIFF files, and I have an error. I'm trying to grab a raster with the values of pollution agents in Europe, so I'm not interesting to keep an high level of resolution of the image, but only to keep data, I can manipulate the image. My code is very simple: from __future__ import print_function import numpy import urllib2 from PIL import Image f = open('./maccrasters/prova.tif','w') fullMap = urllib2.urlopen("http://wdc.dlr.de

How to read a TIFF file by tiles with Java?

蓝咒 提交于 2019-12-10 13:54:54
问题 Let's say I have a very large TIFF image as input. I am not able to load this image entirely because of memory specification I must comply with. So the following is not an option : BufferedImage data = ImageIO.read(image); Is there any Java library allowing to read a specific part of the image without buffering the whole image ? Or some ways to get TIFF tiles from a stream ? 回答1: ImageIO can provide you an ImageReader for Tiff, and then you can use readTile. ImageIO has several

Create a multiframe .tif file

纵然是瞬间 提交于 2019-12-10 13:28:15
问题 I have pixel data that I want to use to create a new .tif image that has multiple frames. How would I go about doing this? I have tried python PIL however I have only found it supports multiple frame reading not writing. See below for my attempt that didn't work. new_Image = Image.new("I;16", (num_pixels,num_rows)) for frame in range((len(final_rows)/num_rows)): pixels = new_Image.load() for row in range(num_rows): row_pixel = final_rows[row].getPixels() for pixel in range(num_pixels): pixels

Return tiff file from outputstream on JSP

a 夏天 提交于 2019-12-10 12:04:07
问题 I am using a JSP to display a single TIFF file. The flow is as follows: I am given a PDF to convert to a TIFF. I feed a 'black box' API the PDF in the form of a File object and an OutputStream (I am currently using a ByteArrayOutputStream but that can change as needed. The 'black box' converts the PDF to a TIFF and saves the result to the OutputStream. I use out.println(outputstream) to spit out the TIFF. The problem is that I am getting a text stream instead of a displayed image. I have used

Options to Convert 16 bit Image

岁酱吖の 提交于 2019-12-10 11:50:47
问题 when i open a 16 bit image in tiff format, it opens up as a black image. The 16-bit tiff image only opens in the program ImageJ; however, it does not open in Preview. I am wondering what my options are now to view the format in an easier way that does not reduce the resolution than to open ImageJ to view it. Should I convert it to an 8-bit format, but wouldn't I lose data when the format is reduced from 16 to 8 bit? Also, I was thinking about converting the tiff image to jpeg, but would that

Javascript lossless image compression

大兔子大兔子 提交于 2019-12-10 11:16:54
问题 I am looking for a way to encoding a bmp image as a tiff or some other standard, compressed but lossless format in a browser (javascript). I guess if worst comes to worst I can write a library myself (getting the data from a canvas element) but I was hoping either: there's a better way to do it or someone else has already written something similar (I can't find a library). I have users wanting to upload ~ 4mb (8-bit monochrome) bmp files, which I can losslessly compress to ~700kb tiff files

How do I convert multiple png images to a single tiff file

折月煮酒 提交于 2019-12-10 11:03:29
问题 I have a byte array of several images in the png format. I have to convert this to a tiff file and then into the corresponding byte array. This tiff file will hold multiple images. I have searced a lot, but I haven't been successful. The catch is. i have to do this in java only!! :) Can anyone provide some insight as regards my issue? I wont benefit from ImageMagick etc, because i have a server component that handles this conversion, and then saves it in the backend as a tiff. The client gies

Matlab only opens first frame of multi-page tiff stack

浪尽此生 提交于 2019-12-10 10:59:54
问题 I've created multi-page tiff files with a macro in ImageJ, and I'm now trying to open it using matlab, but I can only access the first frame. Here is the result of imfinfo(filename). Accordingly, I get length(imfinfo(filename)) = 1 Filename: [1x129 char] FileModDate: '28-nov-2013 12:27:51' FileSize: 6.7905e+09 Format: 'tif' FormatVersion: [] Width: 512 Height: 512 BitDepth: 8 ColorType: 'grayscale' FormatSignature: [77 77 0 42] ByteOrder: 'big-endian' NewSubFileType: 0 BitsPerSample: 8