3
$\begingroup$

I want to draw an image pixel by pixel using Manipulate. My code almost works but it erases the old points each time.

image0 = Image[Table[0, {x, 1, 512}, {y, 1, 680}]]

Manipulate[
  ReplacePixelValue[image0, coordList[[i]] -> 1], 
  {i, 1, Length @ coordList}]

coordList is the list of the pixels that get changed from 0 to 1 in the image.

$\endgroup$
3
  • 2
    $\begingroup$ you should show us coordList $\endgroup$ Commented Jan 12, 2016 at 21:47
  • $\begingroup$ Best for you to use your simpler solution rather than the answer that was posted given it was not acceptable $\endgroup$ Commented Jan 18, 2016 at 22:06
  • $\begingroup$ @MikeHoneychurch, I need to post my answer, could you reopen the question, please. $\endgroup$ Commented Jan 21, 2016 at 16:51

1 Answer 1

0
$\begingroup$
emptyImage = Image[Table[0, {i, 1, 300}, {j, 1, 400}]]

coordList=RandomInteger[{100,200},300,2];

Manipulate[ReplacePixelValue[emptyImage, coordList[[1 ;; i]] -> 1], {i, 1, Length[coordList], 1}]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.