473,508 Members | 4,179 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

why are my colours changing when i use imagetruecolortopalette() ?

69 New Member
I have an image 4x4 pixels, each pixel has the exact color that i want e.g #439902 etc,

I grab my image convert it to a palette using gd's imagetruecolortopalette() function, then i try to find the closest color in my image to another predefined color using imagecolorclosest() function, the problem is that it brings back a different color altogether, one thats not in my 4x4 image, the color is close to one of my colors but i need it exact.

I think the problem is that when i use to imagetruecolortopalette() function all the colors in my 4x4 image slightly change,

Is there a way round this problem.?
Jun 10 '12 #1
0 1068

Sign in to post your reply or Sign up for a free account.

Similar topics

4
1957
by: david.graham18 | last post by:
Hi I spotted some nice code to change the background colour of a web page to one of four different colours at random but I can't find it now! The method was to select a number at random from 1...
2
1959
by: Alpha | last post by:
I have a window application. On one of the form, there is a listbox and a few combox. The lstSchItem has a dataview as a datasource. The comboxes are bind to its selected value but through the...
1
8564
by: Paul M. Frazier, Ph.D. | last post by:
I am writing a user information update page and I populate the form on Page_Load with the current values of the user's name, etc. When I change the text in one of the textbox controls (e.g.,...
3
1556
by: Pavan | last post by:
Hi All, I am having a wierd problem while displaying my panel. My code is something like this <table> <tr> <td width=100>label</td> <td width=100>label</td> <td width=100>label</td> <td...
2
7576
by: j1808 | last post by:
hi there, so yes, im am trying to make my label flash diffrent colours, so when i have enterd a value in some textbox which does not meet my parameter, (i.e runs the ELSE in an IF..) it runs this...
0
1209
by: nicky77 | last post by:
This is a long shot, but I have no idea why my navbar is being temperamental in IE6. Everything looks ok on page load, but when you fill out the online form and click Submit, the navbar either...
0
965
by: Chuckk Hubbard | last post by:
I solved this problem. I still don't understand why, but it seems Python was appending a reference to the first element at the end of the list, rather than copying the data. I used something...
1
1168
by: Chuckk Hubbard | last post by:
Hello. This program is clunky, I know; I'm not a programmer, but I need to use this program, so I'm writing it. The problem: I have a cursor following the mouse that shows frequency ratios of...
1
3654
by: Alex | last post by:
Hi, I have a strange question... I have a series of combo boxes being populated by the same dataset, and I've noticed if one is changed then all change as well. I'm using Visual Basic 2005 and...
7
2316
by: dbonin1599 | last post by:
I have the following code, which is going through a FOR loop to run an INSERT statement with a nested SELECT statement. The issue is that I am trying to use the interator in the SQL statement, but...
0
7228
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,...
0
7332
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,...
1
7058
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...
0
7502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5635
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,...
1
5057
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...
0
1565
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 ...
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
426
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...

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.