473,587 Members | 2,580 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

TIFF Image conversion

Hi,

I need to convert a 24-bit RGB TIFF image to an 8-bit RGB TIFF image.
I've tried using PIL and the convert() method - this allowed me to
convert to an 8-bit grayscale image, close but not exactly what I need
:(

From what I've read, it doesn't look like I can do what I need in PIL.
Does anyone know of another method ?

Thanks,

Alastair.
Jul 18 '05 #1
3 3031
I think you could use netpbm to do the conversion.

http://netpbm.sourceforge.net/

I use it for a lot of my TIFF-work that PIL just
doesn't yet support. Wrap a function/class around
an os.system() call to execute it if you want to
call from Python.

HTH,
Larry Bates
Syscon, Inc.

"alastair" <al**********@y ahoo.co.uk> wrote in message
news:23******** *************** ***@posting.goo gle.com...
Hi,

I need to convert a 24-bit RGB TIFF image to an 8-bit RGB TIFF image.
I've tried using PIL and the convert() method - this allowed me to
convert to an 8-bit grayscale image, close but not exactly what I need
:(

From what I've read, it doesn't look like I can do what I need in PIL.
Does anyone know of another method ?

Thanks,

Alastair.

Jul 18 '05 #2
On 12 Jul 2004 07:57:40 -0700, al**********@ya hoo.co.uk (alastair)
declaimed the following in comp.lang.pytho n:
Hi,

I need to convert a 24-bit RGB TIFF image to an 8-bit RGB TIFF image.
Pardon? The only color 8-bit formats I'm familiar with are those
using indexed color (primarily GIF, though PNG may also have that mode).
You are limited to only 256 discrete colors.

-- =============== =============== =============== =============== == <
wl*****@ix.netc om.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
=============== =============== =============== =============== == <
Home Page: <http://www.dm.net/~wulfraed/> <
Overflow Page: <http://wlfraed.home.ne tcom.com/> <

Jul 18 '05 #3
alastair wrote:
Hi,

I need to convert a 24-bit RGB TIFF image to an 8-bit RGB TIFF image.
I've tried using PIL and the convert() method - this allowed me to
convert to an 8-bit grayscale image, close but not exactly what I need
:(


With the caveat expressed above (that there may well not *be* such a
thing as an 8-bit RGB TIFF), you may want to look into using ImageMagick
(and the Python API for it) for your image manipulation. See
www.imagemagick.org for more information.

Jeff Shannon
Technician/Programmer
Credit International
Jul 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
17892
by: Nicolas Guilhot | last post by:
Hi all ! I have a multi-page Tiff image file that I want to convert to PDF. To do so I am using iText library. The conversion is working, but the code execution is very different according to wich iTextSharp.text.Image.getInstance(...) signature I am using : - using code 1 below, the conversion is fast enough but the resulting PDF file is...
1
12287
by: Maurice Mertens | last post by:
Hello, I'm having troubles with saving a tiff-file with a certain compression and colordepth. This is the code I use: ---------------------------------------------------------------------- private sub MakeTiff dim imgSource as new bitmap(strTifSourceFile)
2
1531
by: wayne | last post by:
Hi, May I know how to use VC++ to write a program that can read a TIFF image file? thanks alot --
3
5859
by: T. Davis | last post by:
In C#, I am able to successfully stream a TIFF image that comes from a BLOB field in a database, save it to file, then convert the pages within TIFF file into jpegs (using GDI+) and display on the web (using ASP.NET). However, when I generate the Image object using FromStream (passing in the MemoryStream containing image bytes), an...
2
3573
by: Al Reid | last post by:
Is it possible to display an image that is stored on the server as a TIFF image, on an ASP.Net page without the use of an add-in viewer? If so, could someone tell me how to do it? TIA -- Al Reid
10
11042
by: rtilley | last post by:
Hope it's not inappropriate to post this here. Could someone critique my code? I have no Python programmers in my office to show this to. The script works OK, but should I do it differently? I especially don't like how I check to see if jpegs exist. The style may not be acceptable to some, but I'm concerned with substance, not style. Is...
7
3778
by: Ben | last post by:
Hi We are looking for a component that offers that offers the below for Tiff files: Image clean-up (deskew, despeckle) Printing capabilities from VB The ability to add text to image, e.g. time / date Nice to have:
5
3026
by: massimoal | last post by:
Hi all, I need to convert a tif image, grabbed by a pixelink industrial camera, to a text file (1024x768 elements) but I really don't know how. Surfing the net I found that there are a lot of methods to write a tiff image but how can I understand which is the one used in mine? Can you suggest me some example of code I can use to read the...
2
4968
by: mndprasad | last post by:
hi all i am doing a project in java where i need to convert 10 jpeg images into a single tiff image..conversion of single jpeg image to single tiff is happening but embedding all the 10 jpeg images into a single tiff is not happening..i hav tried out with single image conversion.. My code is *********************** import...
0
7918
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7843
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8206
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7967
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5713
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3840
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2353
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1185
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.