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

Home Posts Topics Members FAQ

Image.putpalett e(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 6267
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(ra nge(256))"

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

lut = im.resize((256, 1))
lut.putdata(ran ge(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
2528
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 sliders (RGB) on a website and a button to process it. Is this at all possible and could someone point me in the right direction or
0
1247
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: Clipboard.SetDataObject( ChartBitmap ); after which I paste that bitmap into MS Word. Some of the colors change or don't show up when the bitmap is pasted into Word. This
4
3724
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 "image/gif" and save the image by doing: myBitmap.Save(response.outputstream,ImageFormat.Gif) and this works, BUT it uses a horrible halftone palette to reduce the colors. I have been trying for a day and a half to figure out any way to reduce the...
0
758
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
2538
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
1398
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 same in all Mac browsers, including IE 5.3 Can't remember for sure but I think it is also happening on IE 6/Windows and other Windows browsers.
7
17049
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 = "photo/thumbs/"; // Path To Thumbnails Directory $twidth = "125"; // Maximum Width For Thumbnail Images
10
7055
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 only small sized iamages.. for eg. resizing takes place for 70 kb sized images but fails for 600kb or more.. my code is below..
2
2002
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 "Internet Options", switch to "Advanced" tab and enable "Print background colors and images" in "Printing" section. But I dont want this beacuse it is browser compatable. I need a code for print whole content when I click print.
0
8324
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,...
0
8842
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8740
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7352
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...
0
5642
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
4173
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
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1970
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1733
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.