Re: Matrix Rotation in Python?

Extracted raw image data typically comes in byte string format, and each pixel value comes as 4 bytes representing Red, Green, Blue, and Alpha offsets, though not always or with all formats. Usually when handling that kind of data I use an NxN matrix with 4 elements per index, numpy would also make the kind of necessary transformations rather trivial, though that may not be the point of the current exercise.

Running the code it seems to flip it horizontally rather than rotate it by 90 degree's, although this may depend on matrix and data formatting. With a rotation you may want to populate a new array with elements from the original, because otherwise you may be overwriting existing elements of the data as you transform it. A different approach may be to read each horizontal column of the original array, and append each element to the vertical column of a new array.

-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector

Reply via email to