One CLUT for 30 picture

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Amarok
Posts: 7
Joined: 2013-03-01T06:12:26-07:00
Authentication code: 6789

One CLUT for 30 picture

Post by Amarok »

Hi all !

I have to generate only one lookup table for 30 pictures.
I find that we can use -fx operator to generate CLUT from one picture but how could i generate only one CLUT for, 30 pictures can use the same CLUT?

Thanks in advance ! :)

Amarok

PS :I need CLUT txt information like that :

Code: Select all

const uint32_t changing_col_bgnd_30_CLUT0[] =
{

0xFF000000,0xFF141314,0xFF0B0C0B,0xFF1B1C1B,0xFF0E0E0E,0xFF040304,0xFF252525,0xFF242324,
0xFF212121,0xFF1E1E1E,0xFF191919,0xFF0A0A0A,0xFF0C0B0C,0xFF121212,0xFF1C1B1C,0xFF161616,
0xFF060606,0xFF131413,0xFF232423,0xFF292929,0xFF2D2D2D,0xFF4B4C4B,0xFF444344,0xFF323232,
0xFF454645,0xFF616261,0xFF5B5C5B,0xFF030403,0xFF2B2C2B,0xFF4E4E4E,0xFF727272,0xFF858585,
0xFF757575,0xFF515151,0xFF7A7A7A,0xFF9D9D9D,0xFFAEAEAE,0xFF393939,0xFF343334,0xFF3E3E3E,
0xFF6D6D6D,0xFF6A6A6A,0xFF656565,0xFF737473,0xFF575857,0xFF949394,0xFFCECECE,0xFFD8D8D8,
0xFFBEBEBE,0xFF070807,0xFF504F50,0xFF555555,0xFF8A8A8A,0xFFC9C9C9,0xFFD2D2D2,0xFFC2C2C2,
0xFF1F201F,0xFF080708,0xFF5E5E5E,0xFF494949,0xFF919191,0xFFABABAB,0xFF999999,0xFF414141,
0xFF595959,0xFF333433,0xFF4F504F,0xFF0F100F,0xFF363636,0xFF828282,0xFF7C7B7C,0xFF3B3C3B,
0xFF8D8D8D,0xFF373837,0xFF7D7D7D,0xFFA5A5A5,0xFFB1B1B1,0xFF2F302F,0xFF969696,0xFFC5C5C5,
0xFF5F605F,0xFF747374,0xFFBAB9BA,0xFFB5B5B5,0xFF8B8C8B,0xFFABACAB,0xFFD5D5D5,0xFF838483,
0xFFA1A1A1,0xFF8C8B8C,0xFF7B7C7B,0xFF777877,0xFF201F20,0xFF878887,0xFF818285,0xFF262629,
0xFF68678F,0xFF8080B7,0xFF616273,0xFF3B3B41,0xFF3B3C48,0xFF1B1B20,0xFF2A2A41,0xFF6A6AB7,
0xFF7B7BCA,0xFF9090AF,0xFF44434C,0xFF454650,0xFF272830,0xFF626274,0xFFB1B1DA,0xFFC5C5E2,
0xFFA8A9C7,0xFF494952,0xFF4B4B56,0xFF32323B,0xFF6B6B85,0xFFB9B9DD,0xFF9D9DC9,0xFF5B5A5D,
0xFF4B4C57,0xFF37373F,0xFF616184,0xFF9898D2,0xFF9797C8,0xFF5C5C61,0xFF4C4C57,0xFF62617F,
0xFF8989CF,0xFFB6B6DE,0xFF46464F,0xFF181718,0xFF4B4B64,0xFF7575C4,0xFFA4A4C2,0xFF43434A,
0xFF41424F,0xFF24242C,0xFF141529,0xFF5F5FAC,0xFF5D5DC4,0xFF8080A0,0xFF38393E,0xFF373742,
0xFF131317,0xFF70708A,0xFF7E7EAA,0xFF51515B,0xFF1F1E20,0xFF171817,0xFF888788,0xFF302F30,
0xFF3F403F,0xFF6F706F,0xFF403F40,0xFF272827,0xFF8F908F,0xFF383738,0xFF100F10,
};
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: One CLUT for 30 picture

Post by snibgo »

I don't understand the problem. Any number of images can be processed with the same CLUT. (I do it all the time for video.)

The IM command is:

Code: Select all

convert inimage clutimage -clut outimage
Once you have created the clutimage, you can use it as many times as you want.
snibgo's IM pages: im.snibgo.com
Amarok
Posts: 7
Joined: 2013-03-01T06:12:26-07:00
Authentication code: 6789

Re: One CLUT for 30 picture

Post by Amarok »

Each image i have, got a different CLUT.
I would extract one of theses and use it for all or extract one CLUT who contain lookup table of all picture.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: One CLUT for 30 picture

Post by snibgo »

How do you create the CLUT?
snibgo's IM pages: im.snibgo.com
Amarok
Posts: 7
Joined: 2013-03-01T06:12:26-07:00
Authentication code: 6789

Re: One CLUT for 30 picture

Post by Amarok »

Any idea :?
Mine in the first post is thanks to a specific soft who convert image in C code.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: One CLUT for 30 picture

Post by snibgo »

Sorry, I still don't understand your problem. Why do you want to generate one CLUT file for 30 images? What do you want the CLUT to do?
snibgo's IM pages: im.snibgo.com
Amarok
Posts: 7
Joined: 2013-03-01T06:12:26-07:00
Authentication code: 6789

Re: One CLUT for 30 picture

Post by Amarok »

I have 30, 8bpp indexed car, pictures. If they're animated the car turn around.
In my program, there is 3 layer :

1 layer background
1 layer paint
1 layer effect

The program only load one CLUT so i can't generate 30 different CLUT.
So he apply the first picture CLUT to all other.

So the first picture is good and all other background picture are ugly...

That why i want only one CLUT or regroup the 30's.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: One CLUT for 30 picture

Post by snibgo »

What do you want the CLUT to do?
snibgo's IM pages: im.snibgo.com
Amarok
Posts: 7
Joined: 2013-03-01T06:12:26-07:00
Authentication code: 6789

Re: One CLUT for 30 picture

Post by Amarok »

What i want her to do ?
What she should do.

Store picture color?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: One CLUT for 30 picture

Post by snibgo »

I don't understand what problem you are trying to solve.

I use CLUTs for video, to balance colour and tone between shots. Each shot has one CLUT, applied to all the frames within the shot. To create the CLUT, I examine one frame in Gimp and create the curves. The video editor then reads the Gimp curves and creates the CLUT file, and uses ImageMagick to apply the CLUT to every frame. The process works well.

Perhaps, for a special effect, I might want to vary the CLUT across the shot, for example to change the colour balance from daylight to interior. I could use ImageMagick to help, perhaps by blending or morphing the CLUT files.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: One CLUT for 30 picture

Post by fmw42 »

Append all the pictures into one (if they are small enough), reduce the colors of the appended image to 256 colors (-dither none -colors 256), then create an image colormap from those colors (which you can find in the colortable in the verbose info: or from -unique-colors) and use -remap to apply it to all the images.

see
http://www.imagemagick.org/Usage/quantize/#colors
http://www.imagemagick.org/Usage/quantize/#extract
http://www.imagemagick.org/Usage/quantize/#remap_common
and the example below it for web safe coloring shows you something similar
Post Reply