Convert from TIFF to PNG using Windows? - png

Is there a way to convert all TIFF images to PNG using windows console or any simple tool.
I renamed tags, but the problem now is file size. What are ways to compress files?

imagemagick, it's CLI tool for image manipulation available for most major operating systems including Windows http://www.imagemagick.org/script/download.php
It's very simple to use it
convert in.tiff out.png
To convert and scale by 50%:
convert in.tiff -resize 50% out.png
Here you can find full list of general commands

TinyPng is great to compress png files, you can try that.
www.tinypng.com

Related

How do I use imagemagick to convert HEIC to JPG and preserve quality?

I'd like to batch convert .heic images (e.g. iPhone photograph) to .jpg files with imagemagick, with the goal of retaining as much of the quality from the original image as possible. To be clear, the resulting output size is not a concern.
I've been using
magick input.heic -quality 100% output.jpg
Is it possible to do better?
No, its not possible to do better per ImageMagick's website:
Set the quality to 100 to produce lossless HEIC images. Requires the libheif delegate library.
I interpret lossless as NOTHING is lost from original picture. However since you ARE converting to another file type maybe its possible you lose something, are you seeing any artifacts/issues?

How to open a .img/.rrd satellite image in Matlab?

I have a couple of multispectral satellite images which are in .img/.rrd format and I want to oopen them in Matlab for further processing.
I'm not sure Matlab can recognise .img /.rdd files directly, but you could try using ImageJ or Fiji to convert your .img files to one of the image formats that is accepted. e.g. tiff, png, bmp, jpeg. The list of accepted formats can be found by typing 'imformats' in the command line.

Convert tiff to dicom using Matlab

I have a series of dicom images and did change the HUs in the images using MATLAB scripts, then I imported them in ImageJ for display. Then I realised I can modify the images using ImageJ gui (which much easier, just moving the mouse). However, when I saved the modified images in ImageJ, they were saved in tiff format.
My question is that, is there a way to save images in imageJ as dicom format ?
or is there away to convert tiff format to dicom using MATLAB ?
Any suggestion ?
You can convert tiff format to dicom with dicomwrite:
dicomwrite( imread('input_image.tif'), 'output_image.dcm')
The following plugins allow writing DICOM files directly from ImageJ:
DICOM Import and Export plugins
The Tudor DICOM Tools

Ghostscript converting Postscript to PNG is over-saturated

I'm trying to use Ghostscript and/or ImageMagick to convert each page of a Postscript document into PNG images. The problem is that both produce images that are way too saturated (I think that's the right terminology).
Here are the commands I'm trying:
gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=png16m -dGraphicsAlphaBits=4 -sOutputFile=page_%02d.png brochure.ps
convert brochure.ps im_page_%02d.png
This is the input Postscript file (brochure.ps from above)
Here's a couple of the output images I'm getting:
Page 1
Page 6
As you can see (especially on the page with the big green map of New Hampshire), the colors of the output PNGs are too bright/saturated. How can I prevent the colors from being changed so much and get a more accurate conversion?
Preview in OS X 10.6 automatically does a very accurate conversion to PNG when you open a Postscript file in it. This leads me to believe there is just something screwy with the way ghostscript converts ps->png (I'm fairly confident ImageMagick is just a wrapper for ghostscript for this operation). Is there a tool besides ghostscript I should be using instead?
Note: As pipitas points out below, the visible difference of colors varies by OS. It is very obvious in OS X 10.6, but apparently not very noticeable in Windows XP.
You are right in assuming ImageMagick just being a wrapper for Ghostscript when converting from PostScript or PDF to an image format.
I think, this problem can only be solved to anybody's satisfaction once the efforts to add support for ICC profile handling and color management (currently underway) are completed for Ghostscript (design document as PDF). That point in time is close, however. If I understand recent commits to http://svn.ghostscript.com/trunk/ correctly, the next release (which will be dubbed 9.00 and out hopefully in August) will include support for color management via LittleCMS. Yay!
OSX 10.4 and up provide sips (scriptable image processing system) and it works well with PDF format. Perhaps it can be a temporary solution until Ghostscript supports color management.

Setting DPI for PNG files

I have a bunch of diagrams created using a Java diagramming tool that I wrote - they are mostly black and white diagrams, with the blocks in aqua, and occasional other colours. They are currently being saved as JPG files, and I want to insert them into a book that I am preparing for Print On Demand.
The book is an OpenOffice ODT file, which will later be converted to a PDF.
Currently I use JPG files, but the print facility they use requires 300 DPI, so I modified my diagramming tool to set the xDensity and yDensity to 300, and resUnits to 1, using getAsTree(), and then expand the diagram by a factor of 3 (300/96). IMO the result looks pretty good!
Unfortunately, someone on another forum pointed out that line diagrams are "fuzzed" on JPG files, so suggested that I change over to PNG, or possibly BMP files, both of which ODT files allow to be inserted.
My problem is that BMPs don't seem to have a DPI, and PNGMetadata doesn't seem to support getAsTree(). Can someone point me in the right direction? Thanks.
I don't understand the getAsTree() part, but answering the question that appears in the title, setting dpi for PNG files, you could use the imagemagick convert tool:
convert -density 300 -units pixelsperinch infile.jpg outfile.png
PNG, BMP and dozens of other image formats don't compress your diagrams - compression is probably what your commentor was getting at. JPEGs are great for photos but suck at diagrams.
You might want to look into SVG and other vector formats. Or if your environment allows, exporting 0% compression JPEGs and converting them into another format for lossless reproduction at 300DPI.
Hope that helps!
I decided not to try to do this programmatically. Instead I create the original diagram in PNG, then convert to 300 DPI using Irfanview. Irfanview's batch capability lets me convert to 300 DPI, scale up to compensate, and set to grey scale, all in one operation - and on multiple files at a time. This seems to be the best solution - but thanks to everyone anyway!