1 / 3

Manipulating Pictures, Arrays, and Loops part 4

Manipulating Pictures, Arrays, and Loops part 4. Another Exercise- Clear the Blue Values. What if you want to clear the blue from a picture? Set all the blue values to 0 for all the pixels The algorithm is similar to decreaseRed() and increaseRed() except

idola
Télécharger la présentation

Manipulating Pictures, Arrays, and Loops part 4

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Manipulating Pictures, Arrays, and Loopspart 4 Georgia Institute of Technology

  2. Another Exercise- Clear the Blue Values • What if you want to clear the blue from a picture? • Set all the blue values to 0 for all the pixels • The algorithm is similar to decreaseRed() and increaseRed() except • You don’t need to get the value out for blue and multiply it by some value and then set the blue value • Just set the blue value to 0 Georgia Institute of Technology

  3. Clear Blue Exercise • In Picture.java • Write the method • public void clearBlue() • That sets the blue value to 0 for all pixels in a picture • Test with: String fileName = “c:/intro-prog-java/mediasources/caterpillar.jpg”; Picture p = new Picture(fileName); p.explore(); p.clearBlue(); p.explore(); Georgia Institute of Technology

More Related