Home > OS >  Move pixel from one place to another in Julia
Move pixel from one place to another in Julia

Time:05-18

I was curious how would I move pixel with particular coordinates to another location? Or in other word, change the locations of pixels in the image? And then output the changed image again.

using Images
img_lab = rand(Lab, 10, 10)

output

For example pixel in (1,1) move to (2,3) and overwrite the existing pixel.

Later I want to implement this idea to real images and to all pixels in the image.

CodePudding user response:

img_lab[2,3] = img_lab[1,1]

The image is just a matrix, and you manipulate its elements the same way.

  • Related