PhotoshopForums.com Home
Navigate Contact FAQ Search Members
Create gradient color palette
Post new topic   Reply to topic    PhotoshopForums.com Forum Index -> Actions and Automation
 See a User Guidelines violation? Please contact us.
Author Message

LOBBS

Joined: 29 Nov 2009
Posts: 6



PostPosted: Fri Mar 09, 2012 3:45 am    Post subject: Create gradient color palette Reply with quote

For a project we are working on I need to input a couple of RGB values into a script or utility of some kind and generate a color palette laid out in a gradient fashion to use in an indexed bitmap.

Basically we are creating uniforms and the program reads the numbers as a set and all the images for the numbers are cross referenced to each other to ensure the color palettes match to each other. There are obviously ten numbers and those numbers are in three locations so all 30 images have to have the same color palettes.

We have around 350 of these uniforms each with their own color palette. The image is an 8-bit format image but out of the sheer amount of maintenance required to ensure that everything matches we've basically been limited to 15-16 colors or roughly a 4-bit format.

I've made all this work in an Excel spreadsheet but it is extremely time consuming to print out the pages and manually create a 256-color palette.
Basically my background color is the first in the palette, then there are 126 blending colors generated between the background color and the border color of the number, then another 126 colors generated between the border color and the interior color of the number.

The end software is very particular when reading the indexed bitmap about the pixels in the image always being in the same relation to the color on the color palette.

For instance, I make a black jersey with yellow bordered red numbers. The first color in the palette would be black, then 126 colors transitioning from black to yellow. Yellow would be #128 in the palette, then 126 colors becoming increasingly redder until in reached #255 which is the red of the interior portion of the number. Now say I need a white jersey with the same yellow bordered red numbers. The first #127 tiles in the palette would change starting with white and getting progressively more yellow and the last 128 tiles in the palette would stay the same as found in the black jersey. Basically, the program will want to straight swap the black->yellow pixels out for the white->yellow pixels with out any change in order in the color palette.

I swear at one time I saw a script or utility or program that could automatically generate a color palette laid out in a gradient like this but for the life of me I can not find it again. You simply input RGB values that you needed and how many tiles you could use in your palette and it spaced them equidistantly within those constraints. It's really a rather straight forward calculation to figure the blending RGB colors between any given group of base colors it's getting them input correctly into a Photoshop color palette that has me perplexed.

Thanks in advance for your time. I know this sounds like a rather complicated ordeal.

Kyle "LOBBS" Laubscher
View user's profile Send private message

Auieos

Joined: 29 Jan 2010
Posts: 2019



PostPosted: Sat Mar 10, 2012 11:55 pm    Post subject: Reply with quote

Confused you lost me on the second sentence.

I think I'm going to need a PowerPoint presentation to understand this one.
View user's profile Send private message

LOBBS

Joined: 29 Nov 2009
Posts: 6



PostPosted: Sun Mar 11, 2012 4:03 am    Post subject: Reply with quote

Basically I'm looking for a way to auto generate a color table with the colors laid out in a spectrum/gradient like this by selecting three colors: a background (the color of the jersey), a border around the number and the interior color of the number.

In this case I have a color table for a black jersey with yellow bordered red numbers.



Same red numbers with yellow border this time for a white jersey. Observe how the yellow to red gradient portion are unchanged but the background to yellow gradient has changed. Keeping this relationship color table to color table is critical for what we are trying to accomplish.



I have an Excel file to auto-generate the RGB values for the tiles in the color table but is there any way to import those into Photoshop to automatically create a color table? Alternatively, is there another method to perform the task?
View user's profile Send private message

SCTRWD

Joined: 20 Jul 2011
Posts: 79



PostPosted: Sun Mar 11, 2012 7:14 am    Post subject: Reply with quote

You can auto generate a color table by simply selecting the range of colors in the color table and setting the start and end colors.

If you have Excel macro then it is even more straightforward:

Dump your RGB values from Excel to ACT file in this simple format:
R1 - red value of the first tile (1 byte)
G1 - green value of the first tile (1 byte)
B1 - blue value of the first tile (1 byte)
R2 - red value of the second tile (1 byte)
G2 - green value of the second tile (1 byte)
B2 - blue value of the second tile (1 byte)
......
......
......
R256 - red value of the tile number 256 (byte)
G256 - green value of the tile number 256 (byte)
B256 - blue value of the tile number 256 (byte)

It's called "interleaved" order Big Wink

All in all there must be 256*3=768 bytes.
Load this file as a color table.
View user's profile Send private message

thehermit

Joined: 05 Mar 2003
Posts: 3987
Location: Cheltenham, UK


PostPosted: Sun Mar 11, 2012 11:32 am    Post subject: Reply with quote

*cough* great job (for all I know ;))
_________________
If life serves you lemons, make lemonade!
View user's profile Send private message

LOBBS

Joined: 29 Nov 2009
Posts: 6



PostPosted: Sun Mar 11, 2012 12:38 pm    Post subject: Reply with quote

Thanks all, I'll give that a shot.
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PhotoshopForums.com Forum Index -> Actions and Automation All times are GMT - 6 Hours
Page 1 of 1
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Contact - User Guidelines >

Copyright © 2003-2016. PhotoshopForums.com, iFroggy Network. All Rights Reserved.
Powered by phpBB © phpBB Group. phpBB SEO. Privacy Policy.
We are in no way affiliated with Adobe. Photoshop, Adobe and related marks are registered trademarks of Adobe.
PhotoshopForums.com