Questions tagged [indexed-image]

24 questions
44
votes
4 answers

Graphics on indexed image

I am getting error: "A Graphics object cannot be created from an image that has an indexed pixel format." in function: public static void AdjustImage(ImageAttributes imageAttributes, Image image) { Rectangle rect = new Rectangle(0, 0,…
Krivers
  • 1,986
  • 2
  • 22
  • 45
5
votes
2 answers

Python PIL: Create indexed color image with transparent background

I wonder how I could create a image with a transparent background and only 2 indexed colours (red and blue) to minimise the file size? More specifically I have two black and white images that I want to convert, one to transparent and blue and the…
Tickon
  • 1,058
  • 1
  • 16
  • 25
4
votes
2 answers

Resize indexed PNG image with ImageMagick while preserving color map

I am using custom batch script to make resized copies (33% and 66%) of all PNG images in folder. Here is my code: for f in $(find /myFolder -name '*.png'); do sudo cp -a $f "${f/%.png/-3x.png}"; sudo convert $f -resize 66.67% "${f/%.png/-2x.png}";…
Juraj.Lorinc
  • 503
  • 6
  • 26
3
votes
2 answers

Access the color palette of an indexed image in C

Suppose I want to read an indexed image as it is( not the 3 channel 24 bit images) I wish to read and modify the color palette of an indexed image. In opencv I haven't come across any such functions which extract the color palette of an image! Also…
shiladitya
  • 2,290
  • 1
  • 23
  • 36
2
votes
2 answers

How to convert an Indexed pixel format image to a 32-bit image?

I have an image that I get and attempt to load into a graphics object using Graphics.FromImage(image), however this throws an exception if the image has an indexed pixel format. Is there a way to safely convert an indexed image? Update: Thanks to…
Steve T
  • 7,729
  • 6
  • 45
  • 65
2
votes
3 answers

Capture screenshot of program using indexed color table

There are numerous tutorial on the web on how to capture and save a screenshot using C#. For example, I used this website to obtain my solution: using (var screenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width,…
JBSnorro
  • 6,048
  • 3
  • 41
  • 62
2
votes
2 answers

Convert rgb image to an indexed image without decreasing the colors in Matlab

I am doing steganography in indexed image. One of my problems is to convert the rgb image to an indexed image without decreasing the colors. I found out rgb2ind function in matlab converts rgb to indexed using minimum variance quantization and…
Fitri
  • 47
  • 1
  • 7
2
votes
1 answer

Do indexed Surfaces support palettes with alpha values (other than 255)?

When I call myIndexedSurface.get_palette(), it returns a list of 32-bit RGBA values. I figured that because there is an alpha value included, I might be able to set and use palette indices with transparency effects, too. These surfaces could then be…
Augusta
  • 7,171
  • 5
  • 24
  • 39
2
votes
1 answer

What Algorithm(s) do(es) rgb2ind() in MATLAB use?

I am reading the documentation of the RGB2IND function, and found that it uses Uniform Quantization, Minimum Variance Quantization, and Inverse Colormap, though I don't quite get how these fit into the algorithm given the parameters. Are there any…
Patrick Roberts
  • 49,224
  • 10
  • 102
  • 153
1
vote
0 answers

How to display color indexed image?

Let say i have single channel image (2d matrix) with some width and height and with limited range integer values, lets say 0..14. I want to display this image/matrix on screen, but each value should be colored with custom predefined color (i.e color…
Mendi Barel
  • 3,350
  • 1
  • 23
  • 24
1
vote
1 answer

Is there a way to merge palettes for indexed pygame.Surfaces?

I have a Surface BaseSurf with an indexed colour palette, and I want to blit another indexed-colour Surface to it (let's call it NewSurf). BaseSurf's palette is different from NewSurf's, though, and pygame does not automatically add the missing…
Augusta
  • 7,171
  • 5
  • 24
  • 39
1
vote
1 answer

Applying color palette to Texture

Updated after many stupid questions Objective: To apply the texture palette means GL-shaders (emulate Indexed8 texture format). Internet is full of articles on a subject, and all contained the same solution. I have it, unfortunately, it don't work…
Albeoris
  • 109
  • 1
  • 7
1
vote
1 answer

why different commands result in different indexed color figure

I obtain the index map and colormap using [index_map,colormap] = imread('indexed_color_image.tif'); And then I show the result using two different commands. Their results look very different. Case 1: figure;imshow(uint8(index_map), colormap); case…
tqjustc
  • 3,624
  • 6
  • 27
  • 42
1
vote
1 answer

How do I determine if an indexed mode SDL_Surface has transparency or not?

I've got code I've been working with to load and convert SDL_Surfaces to OpenGL textures, however I've realized that they only work with RGB(A) surfaces. I need to extend the support onto indexed mode images (with or without…
zyndor
  • 1,418
  • 3
  • 20
  • 36
1
vote
0 answers

Indexed color using Android's graphics API

I'm making a drawing program for Android and one of the features I would like to support is the ability to adjust colors and see the color changing in real time in the drawing. To represent the drawing, the program internally stores a 2D int array…
Tmdean
  • 9,108
  • 43
  • 51
1
2