tiff

Obtain Latitude and Longitude from a GeoTIFF File

老子叫甜甜 提交于 2019-11-28 15:23:30
Using GDAL in Python, how do you get the latitude and longitude of a GeoTIFF file? GeoTIFF's do not appear to store any coordinate information. Instead, they store the XY Origin coordinates. However, the XY coordinates do not provide the latitude and longitude of the top left corner and bottom left corner. It appears I will need to do some math to solve this problem, but I don't have a clue on where to start. What procedure is required to have this performed? I know that the GetGeoTransform() method is important for this, however, I don't know what to do with it from there. fmark To get the

How to create a multiple frame .tif image using Python PIL

不想你离开。 提交于 2019-11-28 14:19:43
How would I go about creating a new image, using python PIL, which has multiple frames in it. 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[pixel,row] = row_pixel[pixel] print frame new_Image.seek(frame) I tried using the above code but it gives me a EOFError. The code gets the number of frames by dividing the total number of rows that I have by the number of rows per frame. It then uses the data as pixel

C#: How do I convert a multi-page TIFF via MemoryStream into one long image?

两盒软妹~` 提交于 2019-11-28 11:49:46
So I have been able to take a multi-page TIFF file and convert it to a single jpeg image but it flattens the TIFF. By flatten it, I mean it only returns the first page. The goal is to retrieve the TIFF (via memory stream), open each page of the TIFF and append it to a new jpeg (or any web image). Thus creating one long image to view on the web without the aid of a plugin. I do have the MODI.dll installed but I am not sure how to use it in this instance but it is an option. Source Code (using a FileHandler): #region multi-page tiff to single page jpeg var byteFiles = dfSelectedDocument.File

Open huge TIF in .NET and copy parts to new image

房东的猫 提交于 2019-11-28 10:53:39
I'm looking for a library that can open and copy sections of a large TIFF file. I've looked at LibTiff.Net which opens the file very quickly but it doesn't have any functions for cropping or copying sections of the image. My image is 100,000 x 100,000 pixels upwards and creating a System.Drawing.Bitmap of that size crashes the application so converting to a Bitmap first is not an option. Can anyone recommend a .NET library? If your file is less than 4GB on disk than I recommend you to take another look at LibTiff.Net. Even with such large images you have some options. First of all, check

Create Multi-Page Tiff with Java

隐身守侯 提交于 2019-11-28 10:34:38
I'm interested in taking a tif image and adding a layer to it that contains text with Java, preferably with the Twelve Monkeys image library if possible. I can tweak the code from here to either add text to a tif or create a new tif of the same size with only text, but not save them as a multi-page tif. For example: import javax.imageio.*; import javax.imageio.stream.ImageOutputStream; import java.awt.*; import java.awt.image.*; import java.io.*; public class ImageUtil { public static void main(String[] args) throws Exception { BufferedImage src = ImageIO.read(new File("/path/to/main.tif"));

How to run Photoviewer.dll in command line

北战南征 提交于 2019-11-28 09:12:07
When I run the following code below in a command prompt (as administrator): "C:\Program Files\Windows Photo Viewer\PhotoViewer.dll" "C:\00012.tif" it produces error as shown below : "This file does not have a program associated with it for performing this action. Please install a program or, if one is already installed, create an associated in the Default Programs control panel." Both .tif and .tiff are associated in the Default programs control panel. I am trying to call this from a .net windows app. Any help is appreciated. RobinJ rundll32 "C:\Program Files\Windows Photo Viewer\PhotoViewer

Write swing component to large TIFF image using JAI

[亡魂溺海] 提交于 2019-11-28 08:57:12
问题 I have a large swing component to write to TIFF. The component is too large to load the TIFF in memory, so I either need to make a big BufferedImage which is backed by a disk-based WritableRaster (as mentioned here) or use JAI. JAI seems like the better answer, aside from the utter confusion of the project. Given that, can someone outline steps for writing my swing component to a tiled TIFF without running out of Memory? Image size will be maybe 10000x700 Ideally I would create some sort of

Handling Group4 TIFF images in python

╄→尐↘猪︶ㄣ 提交于 2019-11-28 08:24:31
问题 PIL doesn't natively support G4 images, is there some other python package that does? I need to read multi-page TIFF images and pull convert them into gif/png on the fly to serve up in a web page. (I'm not converting them all on the fly, but cherry picking them for display). I've considered using ImageMagick which has that conversion ability, but I'd like to be able to reach into the TIFF files and see what is inside them for indexing. 回答1: See this post about a patch against PIL, this

How to create a TIFF on the iPad

只愿长相守 提交于 2019-11-28 04:34:56
问题 I am trying to create a TIFF image from a UIImage . I looked into Apple's docs but could not find any information. Can anyone help me and explain how to create a TIFF image on an iPad? 回答1: It seems to me that ImageMagick is way overkill just to write tiffs. Why not build libtiff? iOS is supported from it, and is what most software packages use to write tiffs (including ImageMagick). You can even use the libtiff.a file from the ImageMagick link above. Just install the lib and tiff headers

How can I create an Image in GDI+ from a Base64-Encoded string in C++?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-28 04:29:26
问题 I have an application, currently written in C#, which can take a Base64-encoded string and turn it into an Image (a TIFF image in this case), and vice versa. In C# this is actually pretty simple. private byte[] ImageToByteArray(Image img) { MemoryStream ms = new MemoryStream(); img.Save(ms, System.Drawing.Imaging.ImageFormat.Tiff); return ms.ToArray(); } private Image byteArrayToImage(byte[] byteArrayIn) { MemoryStream ms = new MemoryStream(byteArrayIn); BinaryWriter bw = new BinaryWriter(ms)