Return-Path: <tiff-admin@remotesensing.org>
Received: from gee.skynet.be (gee.skynet.be [195.238.2.99])
        by twentyeight.skynet.be (8.12.9/8.12.9/Skynet-MAILSTORE-2.14) with ESMTP id i0NFNC5E005828
        for <joris.at.lebbeke@skynet.be>; Fri, 23 Jan 2004 16:23:12 +0100
        (envelope-from <tiff-admin@remotesensing.org>)
Received: from yoda.imagelinks.com ([208.24.120.42])
        by gee.skynet.be (8.12.9/8.12.9/Skynet-IN-2.32) with ESMTP id i0NFMjGB017504
        for <joris.at.lebbeke@skynet.be>; Fri, 23 Jan 2004 16:22:46 +0100
        (envelope-from <tiff-admin@remotesensing.org>)
Received: from yoda.imagelinks.com (localhost.localdomain [127.0.0.1])
	by yoda.imagelinks.com (8.11.6/8.11.2) with ESMTP id i0NFKQl07284;
	Fri, 23 Jan 2004 10:20:26 -0500
Received: from fuzzylog.simplesystems.org (fuzzylog.simplesystems.org [65.66.246.65])
	by yoda.imagelinks.com (8.11.6/8.11.2) with ESMTP id i0NFJBl07241
	for <tiff@remotesensing.org>; Fri, 23 Jan 2004 10:19:11 -0500
Received: from scooby.simplesystems.org (scooby.simplesystems.org [65.66.246.67])
	by fuzzylog.simplesystems.org (8.9.3/8.9.3) with ESMTP id JAA23957;
	Fri, 23 Jan 2004 09:18:55 -0600 (CST)
From: Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
X-X-Sender: bfriesen@scooby.simplesystems.org
To: Andrey Kiselev <dron@ak4719.spb.edu>
cc: "Tiff@Remotesensing.Org" <tiff@remotesensing.org>
Subject: Re: [Tiff] How to convert MINISBLACK to PHOTOMETRIC_RGB
In-Reply-To: <20040123073933.GA6322@ak4719.spb.edu>
Message-ID: <Pine.GSO.4.44.0401230914411.29988-100000@scooby.simplesystems.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: tiff-admin@remotesensing.org
Errors-To: tiff-admin@remotesensing.org
X-BeenThere: tiff@remotesensing.org
X-Mailman-Version: 2.0.11
Precedence: bulk
List-Help: <mailto:tiff-request@remotesensing.org?subject=help>
List-Post: <mailto:tiff@remotesensing.org>
List-Subscribe: <http://remotesensing.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=subscribe>
List-Id: TIFF and libtiff discussion <tiff.remotesensing.org>
List-Unsubscribe: <http://remotesensing.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=unsubscribe>
List-Archive: <http://remotesensing.org/pipermail/tiff/>
Date: Fri, 23 Jan 2004 09:18:55 -0600 (CST)
X-UIDL: 02a6663887c3eca501da033b3f3e8ea7

On Fri, 23 Jan 2004, Andrey Kiselev wrote:

> On Thu, Jan 22, 2004 at 10:48:14PM -0600, Pushkar Pradhan wrote:
> > When I create a subset image (to take only 3 bands out of 6) IMAGINE
> > software creates a MINISBLACK TIF file (there seems to be no option to
> > change this). This is what tiffinfo reports:
> >   Bits/Sample: 8
> >   Sample Format: unsigned integer
> >   Compression Scheme: None
> >   Photometric Interpretation: min-is-black
> >   Extra Samples: 2<unspecified, unspecified>
> >   Orientation: row 0 top, col 0 lhs
> >   Samples/Pixel: 3
> > Now I want to read this file in MATLAB whose TIFF reader is limited to
> > reading RGB and PALETTED images (that too only 8-bit and 16-bit). Thus
> > it only reads the 1st band of this file. I saw there is utility
> > pal2rgb but is there something similar to min-is-black images to RGB
> > interpretation?
>
> You can rewrite such files using GDAL software. I have implemented
> Photometric setting as an option to the TIFF driver per your recent
> request. You can try to do something like:
>
> $ gdal_translate -of GTiff -co "PHOTOMETRIC=RGB" bad.tif good.tif

How does this treat the two extra samples?  Does it ignore them?

If only the normal gray channel is needed but expressed as RGB, you
can do the same in GraphicsMagick (or ImageMagick):

  gm convert -type TrueColor bad.tif good.tif

Bob
======================================
Bob Friesenhahn
bfriesen@simple.dallas.tx.us
http://www.simplesystems.org/users/bfriesen

_______________________________________________
Tiff mailing list
Tiff@remotesensing.org
http://remotesensing.org/mailman/listinfo/tiff
