Codes P_1_2_2_01

P_1_2_2_01
Grundlegende Prinzipien –  P.1 Farbe –  P.1.2 Farbpaletten –  P.1.2.2 Farbpaletten aus Bildern –  P_1_2_2_01
Basic principles –  P.1 Colour –  P.1.2 Colour palette –  P.1.2.2 Colour palette from pictures –  P_1_2_2_01
Download Code

Pages


  • 190 - 191

  • 192 - 193

Comments

  • 2010-01-03 @ 8:51 pm   |  Comment by Marc

    Hello! How do I use this script for images that are rectangular rather than square? Solely setting up the size doesn't work... The script renders a square area, leaving everything below in a gray color.

    Could someone give me a hint?

  • 2010-01-04 @ 5:27 pm   |  Comment by Hartmut Bohnacker

    Hi Marc, if you want to work with rectangular images you'll need two variables tileCountX and tileCountY instead of tileCount. If you still want that the "pixels" are square, you have to calculate the variable rectSize first. Line 64 and following would look something like this:

    1. int rectSize = mouseX+5;
    2. int tileCountX = width / rectSize;
    3. int tileCountY = height / rectSize;

    Is this hint enough? :-)

     

  • 2010-01-04 @ 8:34 pm   |  Comment by Marc

    Hartmut, thank you very much! Indeed, your hint was really helpful! :-)

    Best regards, Marc.

Leave a Comment

   (required)

   (required)

  

Please enable JavaScript to post a comment.

(.zip, max. 1MB)