Page 1 of 2

Yin and Yang

Posted: Tue Dec 30, 2008 1:56 am
by m!nus
Greetings from Darmstadt? Who from?

Posted: Tue Dec 30, 2008 11:02 pm
by osterlaus
A friend of mine made this challenge. We are a group of students from the Technische Universität (yes, this is the official international name ;)) - but don't ask what we are studying :roll:

Posted: Sun Feb 22, 2009 4:48 am
by theStack
That was a nice challenge - what did you try first? I approached a bitwise (or should I say pixelwise in this case) OR which worked immediately. However the solution was not very readable in white. Did a XOR combination maybe lead to success too?

@osterlaus: Hm, now I'm curious. What are you studying? :lol:

Posted: Sun Feb 22, 2009 9:38 am
by osterlaus
theStack wrote:That was a nice challenge - what did you try first? I approached a bitwise (or should I say pixelwise in this case) OR which worked immediately. However the solution was not very readable in white. Did a XOR combination maybe lead to success too?
Don't ask me why, but this was my first approach. I took red as the result color and this worked even immediatelier as your white as I directly saw the solution.
theStack wrote:@osterlaus: Hm, now I'm curious. What are you studying? :lol:
Just guess ;)

Posted: Mon Mar 16, 2009 4:45 pm
by Chocoholic
Well, that was almost too easy for such an advanced challenge. My first thought was to take the difference of the two images (in Photoshop for example) and that worked perfectly fine.

By the way, greetings from the Leibniz Universität Hannover, Germany. Good to hear that my uni is not the only one with a faible for umlauts in their international name...

Posted: Fri Mar 20, 2009 1:31 pm
by misterjack
I used gimp to solve the challenge. two layer and modus addition or so did it. greetings from universität leipzig :)

Posted: Fri Apr 10, 2009 7:21 pm
by lukas
First tried to read binary code and used the "and" operator. Then I randomly watched the pictures in the Windows Photogalery. When you switch between the pictures in it very fast you can see the answer for a millisecond each switch. So I was very lucky :D

Posted: Sat Apr 11, 2009 2:27 pm
by Chocoholic
lol. Not that's a creative solution. :D

Posted: Sat Sep 12, 2009 4:02 pm
by bearson
when I first saw the 2 pics. I believe it's a XOR. it is ....

somewhat simple 8)

Posted: Thu Sep 17, 2009 1:11 am
by nighthalk
i just used paint, theres a "white is see through" mode which meens if you copy for example white and red pixles onto a white and black background you have the overlay of the red layer on top of the black and white background. did it with that and boom words were in black

Posted: Thu Oct 01, 2009 3:15 am
by Allosentient
I put the two images on top of each other in two layers in Photoshop, and used a difference blending on the layers. I've seen a challenge like this many years ago but it involved 9 or so images of different colors, and blending them yielded a treasure map to which you were supposed to use to get through a maze.

Posted: Wed Oct 20, 2010 10:03 pm
by chephy
I agree that this challenge seems fairly trivial. My first thought was to load the images on top of each other in Photoshop and to play around a bit with the layer modes – total time: 10 seconds.

But, on the other hand, there are not so many people in the solver list, and I am stuck on problems which must seem trivial to other people, so…

Posted: Thu May 19, 2011 12:16 am
by Millennium
I solved this almost immediately, but I got rid of the white, instead of black. It gave the same answer, but was very hard to read.

Posted: Tue Jun 28, 2011 9:17 pm
by AMindForeverVoyaging
It does not really matter whether you use AND, OR or XOR here. Possibly XOR gives the best result for reading.

Code: Select all

import javax.imageio.*;
import java.io.*;
import java.awt.image.BufferedImage;

public class Yin_Yang_Solver {

	public static void main (String args[]) {
		
		try {
			BufferedImage image1 = ImageIO.read(new File("masgo-1.gif"));
			BufferedImage image2 = ImageIO.read(new File("masgo-2.gif"));
			BufferedImage image3 = new BufferedImage(400, 400, BufferedImage.TYPE_INT_RGB);
			
			for(int i = 0; i < image1.getHeight(); i++)	{
				for(int j = 0; j < image1.getWidth(); j++)	{
					int color = image1.getRGB(j,i) ^ image2.getRGB(j,i); // or use &, or use |
					image3.setRGB(j, i, color);
				}
			}
		ImageIO.write(image3, "gif", new File("result.gif"));
		}
		catch(java.io.IOException e) {
			System.out.println("File error: " + e);
		}
	}
}

Posted: Wed Sep 14, 2011 11:09 pm
by compudemon
seems several different layer filters will get the answer. xor and negate being much more readable then additive. for those curious i used Paint.net