473,406 Members | 2,439 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Image.putpalette(Colors)?

Has somebody a example-script how i can put a other palette to a image?
(after this the image should have similar outlook)
Jul 19 '05 #1
4 6247
Oliver Albrecht wrote:
Has somebody a example-script how i can put a other palette to a image?
here's one of the first google hits for "PIL putpalette":

http://effbot.org/zone/pil-pseudocolor.htm
(after this the image should have similar outlook)


similar to what?

</F>

Jul 19 '05 #2
Thanks,
I've read this page.( out of date ?)
http://www.pythonware.com/products/p...tte-images.htm

Very nicely to become answered from the major author and python genius
highly personally himself :-D

Which I want to do is; convert several "RGB" Images (or "P") with one
specified palette (to "P").
Or this (for "P")pattern; if the Source Image has the exact same colors but
wrong(other) paletteIds, how can i sort this? With List.sort()?
And give each pixel the right paletteId? That is what i mean with similar
image (source"RGB" to destinaton"P").

convert() without "WEB"?

(sry if i've enough experience with python)>=newbie

Jul 19 '05 #3
I mean equal outlook.
Or as other objective: give some Images (which has all same colors but
other palettes) for an Animation the same/one palette and nothings is
changed in their outlook
Jul 19 '05 #4
I think in this Example is an fault
lut has the sequence from "im" but not from "lut.putdata(range(256))"

##Getting the Palette Contents Using Resize/Convert
assert im.mode == "P"

lut = im.resize((256, 1))
lut.putdata(range(256))
lut = im.convert("RGB").getdata()
^^
# lut now contains a sequence of (r, g, b) tuples

Fredrik Lundh wrote:
here's one of the first google hits for "PIL putpalette":

http://effbot.org/zone/pil-pseudocolor.htm


Jul 19 '05 #5

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

Similar topics

7
by: Michel | last post by:
Hi folks, I wonder if what I have in mind is possible, maybe even not all that complicated: I have an image, which is a yellow circle. I want this yellow circle to change color by having 3...
0
by: Eric | last post by:
I have written a C# program that creates a new bitmap: Bitmap ChartBitmap = new Bitmap( 780, 360 ); then I create a button which copies that bitmap into the clipboard: ...
4
by: MC D | last post by:
I have a aspx page that outputs an image to the response.outputstream. This works great. However, I want to be able to make the image it outputs a .gif file. I can change the output type to...
0
by: Denise | last post by:
Is there any way possible to change the border color and dropdown image arrow color and style for an asp.net dropdownlist?
5
by: Tony Clark | last post by:
Hi, I have a bmp that is set in a panel, i want to make the white color in the bmp image transparent so i can see the color of the panel below. How is this done? thanks tony
7
by: Wes Groleau | last post by:
Any kind soul feel like ending my efforts to figure out why two images are removing the top few rows of pixels but repeating them at the bottom? http://www.northwestallentrails.org/ Looks the...
7
by: mishrarajesh44 | last post by:
hii all Truly telling i hav got this code from net & i am finding error while running the code below.. code:- <?php $idir = "photo/"; // Path To Images Directory $tdir =...
10
by: mishrarajesh44 | last post by:
hii all, I am facing a problem currently.. i have a script for image uploading and resizing.. the image uploading takes place properly for every size images.. but, the resizing works for...
2
donilourdu
by: donilourdu | last post by:
Hi I am Doni Agna Lourdu. Can any one tell me "How can I print all Web Content" But I know To print background images, open "Tools" menu in Internet Explorer, select...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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,...
0
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...

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.