Yin and Yang

Discussion of challenges you have already solved
User avatar
m!nus
Posts: 202
Joined: Sat Jul 28, 2007 6:49 pm
Location: Germany

Yin and Yang

Post by m!nus »

Greetings from Darmstadt? Who from?
osterlaus
Posts: 20
Joined: Sun Nov 02, 2008 6:04 pm

Post 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:
theStack
Posts: 72
Joined: Sun Nov 02, 2008 12:46 am

Post 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:
osterlaus
Posts: 20
Joined: Sun Nov 02, 2008 6:04 pm

Post 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 ;)
Chocoholic
Posts: 44
Joined: Mon Feb 16, 2009 4:11 pm
Location: UK

Post 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...
misterjack
Posts: 4
Joined: Sat Mar 07, 2009 3:36 pm
Location: Germany

Post by misterjack »

I used gimp to solve the challenge. two layer and modus addition or so did it. greetings from universität leipzig :)
lukas
Posts: 34
Joined: Wed Nov 26, 2008 1:53 pm
Location: Germany

Post 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
Chocoholic
Posts: 44
Joined: Mon Feb 16, 2009 4:11 pm
Location: UK

Post by Chocoholic »

lol. Not that's a creative solution. :D
bearson
Posts: 6
Joined: Thu Sep 10, 2009 8:43 am

Post by bearson »

when I first saw the 2 pics. I believe it's a XOR. it is ....

somewhat simple 8)
nighthalk
Posts: 41
Joined: Fri Jul 31, 2009 8:22 pm

Post 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
Allosentient
Posts: 273
Joined: Thu Apr 10, 2008 9:47 pm

Post 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.
chephy
Posts: 17
Joined: Sat Oct 16, 2010 4:39 pm

Post 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…
Millennium
Posts: 17
Joined: Thu Apr 21, 2011 3:08 am

Post 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.
AMindForeverVoyaging
Forum Admin
Posts: 496
Joined: Sat May 28, 2011 9:14 am
Location: Germany

Post 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);
		}
	}
}
compudemon
Posts: 33
Joined: Sat Aug 13, 2011 2:13 pm

Post 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
Post Reply