473,657 Members | 2,832 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

image: truecolor to palette

Hello

I am trying to reduce a truecolor image to a palette one.
imagetruecolort opalette() works just fine, except, that I would like to
keep a few color unchanged. like a (255,0,0) red, a (255,255,255) white
.... and so on.

My truecolors images are somewhat greenish, with only a tiny bit of red
or white, so when I use imagetruecolort opalette(), those colors are
lost.

It would be great to initialise the destination palette with a few
colors, and then let imagetruecolort opalette() do the job for the rest
of the palette.

Is it possible ?

Thanks

Aug 31 '05 #1
0 1286

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

Similar topics

4
2371
by: Alex Hunsley | last post by:
I'm using python image library 1.1.4 (http://www.pythonware.com/products/pil/) to plot images. However, when I save an image to a gif file, it comes out very dotty/ithered looking, even if it's a picture consisting only of one colour! Here's some example code that produces a dotty gif: #!/usr/bin/python # pymand joy!
0
1797
by: Jean-Sebastien Carle | last post by:
I've been ripping my hair our trying to get this to work for a week and I can't seem to get it. I'm trying to display a 4BppIndexed Bitmap from within the ntoskrnl.exe file that contains no palette. This bitmap is the one everyone likes to change to customize their boot screen. My goal is not to edit the kernel, but simply to display the bitmap content in much the same way a resource editor does. My problem is that no matter what I do, the...
0
1731
by: bearophileHUGS | last post by:
Hello, this time I have a question about PIL usage, maybe if Lundh has some time he can answer me. I am experimenting different color quantization algorithms, so having computed the palette with a clustering function, I use the code below to quantize the original image to produce an image without dithering (so I can see better the quantization results). I have seen that the *standard* distance function I use isn't standard enough,...
0
1244
by: Matteo | last post by:
Hi, i sent image byte via bt from j2me phone to c# application, after i have to create image using this code: .... byte pixels .... Bitmap bmp = new Bitmap(160, 120, PixelFormat.Format8bppIndexed);
0
1307
by: skip | last post by:
I'm unclear how PIL handles multi-frame GIF images. I have such a GIF image in a file, bogus.gif. I can view the individual frames like so (ImageSequence is from the PIL tutorial): ... frame.show() All but the first image appears black-and-white. They apparently lose the color palette associated with the overall image. The palette for the original image and the individual frames is the same, the histograms suggest they have more...
4
10238
by: Dale | last post by:
I am creating GIF images with transparent backgrounds on-the-fly for a web app and rendering them by using System.Drawing.Image.Save(Response.OutputStream, ImageType.GIF). I am confident that the transparency is working properly because if I save the created image to the local hard disk and then view it in a web page or an image editor, the transparency is correct. I can also view the transparency on-the-fly in a Windows.Forms...
1
3016
by: Freedolen | last post by:
Hi, Iam new to this forum. I need to find the given TIFF image is in CMYK or RGB. Though i have checked with Image::Magick, and used: my $img = new Image::Magick; $img->Read("Sample.tif"); my ($type) = $img->Get("type");
3
5187
by: Rajaaa | last post by:
Hello,I put the coding below.Can anyone help me why its not working. <?php header("content-type:image/jpg"); $img=imagecreatefromjpeg("Winter.jpg"); //Convert $img to truecolor echo $w = imagesx($img); echo $h = imagesy($img);
3
3102
by: neovantage | last post by:
Hey all, i have created image by mixing logo and the original image. It create image and show in the same window. I have done 3 steps for this. First i upload an image to my server by using move_upload_file, then i resize it using class "thumbnail.class.php" My next step was to embed company logo in it(which i already done) and save new embedded logo image to the path where i first upload the original image i mean i want to overwrite...
0
8385
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8303
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8502
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
7316
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6162
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1601
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.