Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (567)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Strange optical illusion when moving adjacent colours. Fixes?  (Read 2037 times)
0 Members and 1 Guest are viewing this topic.
Offline hvince95

Junior Member


Medals: 1
Projects: 2



« Posted 2012-11-21 23:48:24 »

I have been trying to get my head around this problem for a while now, and only figured out what the problem is when editing the pictures to post here.  The first picture is of the 'tile map', it is actually one big bufferedImage with a few quads in it.  Here is what it looks like (when stationary):

However, in game, the image is constantly moving around.  And when the image moves left, this is what appears to be shown:

Please note I had to edit this, as when I screenshotted it, the illusion disappeared.  The illusion only effects the seams of some of the quads, but leaves most untouched.
This effect only happens when the whole image is moving to the left.  You can even download the original image, and move it to the left to see the effect (for best results do this with java at a constant speed).
My question is, am I right in this being just an illusion or is there something weird going on with OpenGL, and is there any steps I can take to eliminate the problem?
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #1 - Posted 2012-11-22 00:37:34 »

If you can't capture it in a screenshot, it's probably an artifact of your particular screen, probably due to the high saturation colours you have adjacent to each other. Can you reproduce it by dragging the image around in a paint program? Have you seen it on any other machines?

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline hvince95

Junior Member


Medals: 1
Projects: 2



« Reply #2 - Posted 2012-11-22 01:18:28 »

Can reproduce it in a paint program (just save the image and give it a go yourself, drag the image to the left at a constant speed), and same thing occurs on a macbook pro in its paint program, I am using windows 7.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Best Username Ever

Junior Member





« Reply #3 - Posted 2012-11-22 01:50:18 »

Solid colors can cause strange optical illusions. For example, the bright pink square in your first picture seems to be slightly larger, misaligned with the rest of the grid, and closer to the viewer (probably a function of being brighter and looking larger because it's brighter).

Here's what the picture looks like in grayscale.


Here's what the picture appears to look like (in color) as an exaggerated (grayscale) image.


Here are a few ways I might correct hide optical illusions:
Borders
Blurring
Pattern

I don't know to what extent it will help when there is that much contrast. Maybe it's best to just avoid those colors.

Colour perception is not absolute. Colours appear differently depending on surrounding colours. This is an important factor when selecting colour palettes that work with existing palettes, or combining more than one palette.

Here is more information on colour contrast effects:

http://www.uxmatters.com/mt/archives/2006/01/color-theory-for-digital-displays-a-quick-reference-part-ii.php#colorContrastEffects
Offline Ultroman

JGO Knight


Medals: 25
Projects: 1


Snappin' at snizzes since '83


« Reply #4 - Posted 2012-11-22 08:28:20 »

Colour perception is not absolute. Colours appear differently depending on surrounding colours. This is an important factor when selecting colour palettes that work with existing palettes, or combining more than one palette.

Here is more information on colour contrast effects:

http://www.uxmatters.com/mt/archives/2006/01/color-theory-for-digital-displays-a-quick-reference-part-ii.php#colorContrastEffects
Awesome read!

- Jonas
Offline hvince95

Junior Member


Medals: 1
Projects: 2



« Reply #5 - Posted 2012-11-22 10:23:16 »

Definately a good read, cheers for all the help.  So its not a problem with the colours mixing in Java/OpenGL, but our eyes playing tricks on us!
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 801
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #6 - Posted 2012-11-22 10:40:33 »

It's related to the hardware in your monitor. The slower the pixels change their color, the bigger the effect. It's not an optical illusion, you can film it with a video camera and freeze a frame.

it's probably an artifact of your particular screen, probably due to the high saturation colours you have adjacent to each other.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline princec

JGO Kernel


Medals: 386
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #7 - Posted 2012-11-22 12:40:57 »

The effect is called "persistence".

Cas Smiley

Offline theagentd
« Reply #8 - Posted 2012-11-22 14:49:22 »

On my screen if I move a green box (0x00FF00) over red (0xFF0000) horizontally at 1 pixel per frame (VSynced) the edge between them turns spikey. Seems like my screen updates the colors separately and interlaced in some way. Mainstream screens usually cut corners...

Myomyomyo.
Offline hvince95

Junior Member


Medals: 1
Projects: 2



« Reply #9 - Posted 2012-11-23 12:06:36 »

That is actually very cool, thanks cas!  I'll just have to avoid those colours next to each other.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Pippogeek (39 views)
2014-09-24 16:13:29

Pippogeek (30 views)
2014-09-24 16:12:22

Pippogeek (19 views)
2014-09-24 16:12:06

Grunnt (43 views)
2014-09-23 14:38:19

radar3301 (25 views)
2014-09-21 23:33:17

BurntPizza (62 views)
2014-09-21 02:42:18

BurntPizza (32 views)
2014-09-21 01:30:30

moogie (37 views)
2014-09-21 00:26:15

UprightPath (50 views)
2014-09-20 20:14:06

BurntPizza (54 views)
2014-09-19 03:14:18
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!