Skip to main content
edited title
Link
m_goldberg
  • 108.1k
  • 16
  • 104
  • 259

How to convert Converting a list toof colors into an image

Tweeted twitter.com/StackMma/status/1096333451370872832
Source Link
user305883
  • 467
  • 2
  • 10

How to convert list to colors into an image

I want to manipulate colors, and merge the resulting vector and rasterize it into an image, controlling the resolution of the pixel.

E.g. I tried to:

enter image description here

But what I would like to have is an image of 3 square, blue, red and green, so that:

  • I can control the size of the square (e.g. in pixels, say a square 32x32 each)

  • (possibly!) I can have controls not to have the black perimeter line of the squares.

I can see there is an example to convert a matrix to graphics :

Image[(

but cannot figure out how to achieve that with colors - e.g. by converting the color in values and than shape a matrix NxM..

Final thing, it will be exporting: I'd like to possibly determine the min size of square "pixel" in pixels:

enter image description here

How to convert a list of colors into arrays or matrixes, and then to an image, using above criteria?