Is there anyway I can preserve image georeferencing information after processing or converting the image via IrfanView?
I have a couple of .png files with spatial reference and I'm trying to save them as ecw images. Unfortunately this process destroys the spatial reference vital for using the images in GIS software. If there was a way around this problem it would be a great help.
Thanks.
I would recommend using gdal_translate to handle all your geospatial translation needs.
Assuming that you have a PNG with a world file associated then you can easily convert to ecw (providing that the propitiatory ecw driver is compiled in).
Related
I need to run with tiles on an offline system.
I like the idea of being able to download .mbtiles files,
and extract the tiles.
I downloaded a data set and tried to extract tiles using mb-util.
When I try to extract tiles from the .mbtiles file.
The .png files are not readable.
This isn't a permissions problem.
The .png files don't appear to be .png files.
Any idea why this doesn't work?
Is is not supported?
Does it have something to do with the free data set I'm testing with?
I'm going to have a difficult time getting my company to spend money for
something, if I can't prove the data is valid.
How is fireworks able to store this extra information in a format that is otherwise flat raster. And is there any open source way to write similar vector, layered, paginated files in Png format that would be readable by fireworks?
The PNG format allows for ancillary data chunks to store metadata aside from the image itself. I don't believe anyone's actually worked out the format that Adobe stores that data in though.
Building a system which search for a specific region in the picture, and saves it. Everything works fine. Mostly I am going to extract these regions from pdf books.
So I am looking for a solution to treat PDF file in matlab as an array of images (each page is an image). Up till now the only thing I have found is how to open pdf files in matlab.
The best solution I came up with is to export PDF as many PNG images and iterate through them. There is nothing bad with these idea, but I am wondering am I missing something
Judging from this page it appears to be impossible to import pdf directly into matlab:
And a quick file exchange search for 'pdf import' only offers an attempt to extract text, rather than the images.
So all in all your approach of saving the pdf as images and then importing them seems to be the way to go.
I agree with Salvador Dali and Dennis. To convert each page of the PDF to a png image, I downloaded imagemagick and followed the commands here:
https://aleksandarjakovljevic.com/convert-pdf-images-using-imagemagick/
Specifically:
convert -density 150 -antialias "input_file_name.pdf" -resize 1024x -quality 100 "output_file_name-%03d.png"
Of course, there are other discussion about using ImageMagick for this purpose:
Converting a PDF to PNG and
Convert PDF to PNG using ImageMagick
This is an old thread, but it's the one I found when I asked the same question, so I thought I would elaborate in case it's helpful to future users who also land on this thread.
I was wondering if anybody knows of an API, toolbox, or library that extracts layers from an image format that is supported by a free editor such as Paint.NET (native format: .pdn)
Motivation: An interface to an image with layers that can be edited in a free image editor would be of interest for those of us who do computer vision and machine learning in MATLAB. For example, it could facilitate the automatic collection of manual pixel annotations for supervised learning.
I suggest using the .PSD Photoshop file format, which has layers support and is also implemented by many non-Adobe applications.
The PSD plugin for Paint.NET allows you to open and save PSD images: http://www.psdplugin.com/
You can then use Imagemagick to extract the layers to a format that MATLAB can read:
convert filename.psd filename-%d.png
Almost nothing can read a .pdn file. http://extension.nirsoft.net/pdn
So, you are left with the following options.
Use GIMP to read in the file, and export it into something matlab supports: http://www.mathworks.com/help/techdoc/ref/imread.html.
Use GIMP to read in the file, and export it into something ImageMagick supports:http://www.imagemagick.org/script/formats.php and then convert it into something matlab supports.
Export the data from Paint.NET into a matlab friendly format.
Note, the Matlab links are for the image processing toolbox, if you don't have that, the options are more limited.
I need to add text string to a TIFF image. I am planning to use libTIFF for editing the TIFF image. The plan is to convert text to image using freetype2 and then somehow render the text image on to TIFF. Is this the right approach?
Any pointers on how to convert text to image? I saw the sample code of ft2 - initialising the library, creating face and then setting character sizes. But not sure what to do next? any pointers appreaciated.
One way could be using ImageMagick. They have tools for image composition and text rendering. (and many more)
Although ImageMagick is primarily used from the command line (especially in web environments) several language interfaces are available, too. Java, C, C++, ...
ImgSource is a really nice library for C/C++ on Windows, and it can do this out of the box.
http://www.smalleranimals.com/isource.htm
It's not free, but it's pretty cheap ($59)
You don't tell us which language you need to use, should it be portable or for a given platform, etc.
Using a ready to use existing graphic library, like the (big!) ImageMagick or others like libGD or DevIL might be the easiest way, lot of them have binding for lot of languages.
if youre on windows and in c++ then it's pretty easy to use gdiplus for drawing fonts. you have access to any installed font and you can save the raster out as tiff or jpeg etc as well using the one api.
of course you could also use some combo of freetype and libtiff, but you'll have to build those libs for win32. not that its hard, just more fussing around you may not want to do.