2017년 4월 23일 일요일

coloring pixels


It is possible coloring all pixels 82, 65, 114 (RGB), with another color?

--
It's possible, but extremely slow in App Inventor 2. Depending on your screen resolution and device speed, it may take more than a minute to check all the pixels for the color you want to replace.

--
Changing pixels using App Inventor blocks is extremely slow as Italo points out.  Actually, this could take much longer than a minute depending on the image size.

What you want to do MIGHT be more rapid and possible using a javascript.   The work  would have to be done in a WebViewer ...this link might help  https://www.w3schools.com/tags/canvas_getimagedata.asp   .    I have not tried this. The code would have to be modified for use with AI2.

-- 
Thanks Italo and Steve for your Answers.I would also like to try it.

Any advice on the blocks over WebViewer?
Is there any block AI2 that I can look at?

-- 
Do you know how to use FOR EACH loops?
If you do, create two nested FOR EACH loops, one for the line (y) and the other for the column (x)
Then check each position the loops give you for the color you want to replace. If that x,y = the color you are looking for, draw a pixel in that same position with the new color.

If you don't know how to do that, please learn more basic App Inventor 2 things before trying to do more advanced things.


-- 

It is possible coloring all pixels 82, 65, 114 (RGB), with another color?
probably Mika's Image Editor extension offers a method you could use?

-- 
Wow, I haven't seen those new extensions.

-- 

댓글 없음:

댓글 쓰기