KDOXG

faris_recolor

Oct 19th, 2020 (edited)
722
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Octave 0.53 KB | None | 0 0
  1. I = imread ("faris.png");
  2. for i = 1:rows(I)
  3.   for j = 1:columns(I)
  4.     if I(i,j,1) == 220 && I(i,j,2) == 126 && I(i,j,3) == 212
  5.       I(i,j,1) = 63;
  6.       I(i,j,2) = 89;
  7.       I(i,j,3) = 96;
  8.     endif
  9.     if I(i,j,1) == 194 && I(i,j,2) == 93 && I(i,j,3) == 151
  10.       I(i,j,1) = 194;
  11.       I(i,j,2) = 189;
  12.       I(i,j,3) = 93;
  13.     endif
  14.     if I(i,j,1) == 117 && I(i,j,2) == 69 && I(i,j,3) == 134
  15.       I(i,j,1) = 124;
  16.       I(i,j,2) = 134;
  17.       I(i,j,3) = 69;
  18.     endif
  19.   endfor
  20. endfor
  21. imshow(I);
  22. imwrite(I,"recolor.png");
  23.  
Add Comment
Please, Sign In to add comment