dimanche 15 mars 2015

How to convert an array of HTML colours into into a picture?


I have an array of colors, for example:



A=[['#ff00ff', '#00ff00', '#ffff00', '#00ff00', '#0000ff', '#00ffff', '#00ffff'],
['#0000ff', '#0000ff', '#00ffff', '#00ff00', '#ffff00', '#00ff00', '#00ff00'],
['#ffff00', '#0000ff', '#0000ff', '#ffff00', '#ffff00', '#ffff00', '#ffff00'],
['#ffff00', '#ffff00', '#ffff00', '#ffff00', '#00ff00', '#00ff00', '#00ff00'],
['#00ff00', '#ffff00', '#ffff00', '#00ff00', '#00ff00', '#00ff00', '#00ff00'],
['#00ff00', '#00ff00', '#00ff00', '#00ff00', '#00ff00', '#0000ff', '#0000ff'],
['#0000ff', '#00ff00', '#00ff00', '#00ff00', '#0000ff', '#0000ff', '#0000ff']]


I want to convert this into a picture such that the pixel of coordinate (i,j) has the color A[i][j].


Question: How do I do that in Gimp (or directly in HTML, or anything more relevant)?


Remark: The real array I want to convert is 1000 by 1000 (i.e. 1000000 pixels) so I can’t do this by hand and I need an automatic procedure.





Aucun commentaire:

Enregistrer un commentaire