<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?action=history&amp;feed=atom&amp;title=GMU%3AProcessing_im_Park%2FEmilio_Aguas%2Fsample_code_test05</id>
	<title>GMU:Processing im Park/Emilio Aguas/sample code test05 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?action=history&amp;feed=atom&amp;title=GMU%3AProcessing_im_Park%2FEmilio_Aguas%2Fsample_code_test05"/>
	<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Processing_im_Park/Emilio_Aguas/sample_code_test05&amp;action=history"/>
	<updated>2026-04-21T23:21:05Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.6</generator>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Processing_im_Park/Emilio_Aguas/sample_code_test05&amp;diff=80401&amp;oldid=prev</id>
		<title>EmilioAguas: Created page with &quot;====--- Processing3.0 Code--- ====  Moving the mouse changing the brightness that looks like lightness   &lt;source lang=&quot;java&quot;&gt;  int photos = 2; //maximum of photos int index = 0; ...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Processing_im_Park/Emilio_Aguas/sample_code_test05&amp;diff=80401&amp;oldid=prev"/>
		<updated>2016-04-01T16:09:10Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;====--- Processing3.0 Code--- ====  Moving the mouse changing the brightness that looks like lightness   &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;  int photos = 2; //maximum of photos int index = 0; ...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;====--- Processing3.0 Code--- ====&lt;br /&gt;
&lt;br /&gt;
Moving the mouse changing the brightness that looks like lightness &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
int photos = 2; //maximum of photos&lt;br /&gt;
int index = 0; // first image&lt;br /&gt;
PImage[] pics = new PImage[photos]; //images array&lt;br /&gt;
&lt;br /&gt;
void setup() {&lt;br /&gt;
  size (800, 600);&lt;br /&gt;
  //load the images into the array&lt;br /&gt;
  for (int i = 0; i&amp;lt;pics.length; i++ ) {&lt;br /&gt;
    pics[i] = loadImage (&amp;quot;IMG_024&amp;quot;+ (i+2) + &amp;quot;.jpg&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void draw () {&lt;br /&gt;
  loadPixels();&lt;br /&gt;
&lt;br /&gt;
  //load the pixels of every image&lt;br /&gt;
  pics[index].loadPixels() ;&lt;br /&gt;
&lt;br /&gt;
  //moving throught the pixels in two dimensions&lt;br /&gt;
  for (int x =0; x &amp;lt; width; x++) {&lt;br /&gt;
    for (int y =0; y &amp;lt; height; y++) {&lt;br /&gt;
&lt;br /&gt;
      //position of the pixels in one dimension&lt;br /&gt;
      int pixel_Loc = x + (y * pics[index].width);&lt;br /&gt;
&lt;br /&gt;
      //take the r,g.b values from the image pixel by pixel&lt;br /&gt;
      float red = red (pics[index].pixels [pixel_Loc]);&lt;br /&gt;
      float green = green (pics[index].pixels [pixel_Loc]);&lt;br /&gt;
      float blue = blue (pics[index].pixels [pixel_Loc]);&lt;br /&gt;
&lt;br /&gt;
      //change the brightness according to the mouse position&lt;br /&gt;
      float changeBrightness = ((float) mouseY / height) * 5.0;&lt;br /&gt;
      red *= changeBrightness;&lt;br /&gt;
      green *= changeBrightness;&lt;br /&gt;
      blue *= changeBrightness;&lt;br /&gt;
&lt;br /&gt;
      // Constrain rgb values&lt;br /&gt;
      red = constrain (red, 0, 255);&lt;br /&gt;
      green = constrain (green, 0, 255);&lt;br /&gt;
      blue = constrain (blue, 0, 255);&lt;br /&gt;
&lt;br /&gt;
      //change the pixels for a new value&lt;br /&gt;
      color images = color (red, green, blue);&lt;br /&gt;
      pixels[pixel_Loc] = images;&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  //dispaly the pixels&lt;br /&gt;
  updatePixels();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void mousePressed() {&lt;br /&gt;
  //change the image every time the mouse is clicked&lt;br /&gt;
  index = (index + 1) % pics.length;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>EmilioAguas</name></author>
	</entry>
</feed>