Un Manuel de la Vie

Month

February 2011

Speaking of Ninjas...

I did a couple of nice changes to the Java function I posted before to swap colors in a previously loaded BufferedImage, including variable saturation and brightness to ensure full ninja goodness! =D

Here we go:

void colorearNinja(BufferedImage image,int n_hue,float sat,float val) {

    int c,r,g,b;

    int w = image.getWidth(this);
    int h = image.getHeight(this);

    float hue = n_hue / 360f;
    float hsb[] = new float[3];

    for(int j = 0; j < h; j++)
        for(int i = 0; i < w; i++) {

            c = image.getRGB(i,j);

            b = c & 255;
            g = (c » 8) & 255;
            r = (c » 16) & 255;

            if(r <= g) {

                Color.RGBtoHSB(r,g,b,hsb);

                hsb[1] *= sat;
                hsb[2] *= val;

                image.setRGB(i,j,Color.HSBtoRGB(hue,hsb[1],hsb[2]));
            }
        }
}

Now the function works with a Sub-Zero sprite sheet. Sub-Zero is a very interesting character here because of his color combination: dark grays, blues and oranges for the skin.

image

In a color wheel, blue is exactly opposite orange, which means they are like totally different colors. So this time we are looking for blueish pixels (the ninja suit), while ignoring anything orange enough to pass like flesh.

With a given hue of 50°, we get all that boring blue replaced by Glorious Yellow:

image

And by toying a little more with the function we get a bunch of extra ninjas:

colorearNinja(image,50,1,1);    // Scorpion
colorearNinja(image,0,1,1);    // Ermac (0° means red)
colorearNinja(image,120,1,0.8f);    // Reptile (less brightness for darker green)
colorearNinja(image,0,0,0.8f);   // Smoke (no saturation for graying out)
colorearNinja(image,320,1,0.8f);   // Rain (totally fabulous values!)

image

Noob Saibot is a special case but not a difficult one. I’ll take care of him later,
I guess.

Feb 28, 2011
#digitalimageprocessing #ermac #java #manugames #mk #mortalkombat #paletteswap #programming #rain #reptile #scorpion #smoke #subzero #unmanuel
Feb 28, 201112,909 notes
Feb 27, 201171 notes
Feb 27, 20111 note
#clockwork #orange #kubrick
Feb 27, 201154 notes
#digitalimageprocessing #ermac #java #manugames #mk #mortalkombat #paletteswap #programming #unmanuel
Play
Feb 27, 2011
#magneto #music #mvc3 #marvel vs capcom 3
Feb 27, 20112 notes
#kalinin #k-7
Feb 26, 20111,847 notes
Feb 26, 2011184 notes
Feb 26, 201147 notes
Feb 26, 201181 notes
Feb 26, 20115,191 notes
Tienes un Tumblr excelente! :D

EEEEEE vaya gracias! =D

Feb 25, 2011
Feb 23, 2011750 notes
Feb 22, 20112,606 notes
Play
Feb 22, 20113 notes
#music #silently #silent mobius
Feb 21, 2011383 notes
Feb 18, 201131 notes
Feb 17, 2011240 notes
Feb 16, 2011165 notes
Feb 16, 2011707 notes
Feb 16, 201148,940 notes
Feb 16, 20114 notes
#akumajodracula #castlevania #dracula #genzoman
Play
Feb 15, 2011
#spiderman #italian
Play
Feb 15, 20112 notes
#capcom #music #mega man #wave man
Feb 15, 2011208 notes
Feb 15, 201156 notes
Feb 15, 20116 notes
Play
Feb 14, 2011
#megaman #capcom
Feb 14, 2011707 notes
Feb 14, 20119 notes
Feb 14, 201116 notes
Feb 14, 201113 notes
Feb 14, 20112,775 notes
Feb 14, 2011168 notes
Feb 13, 201121 notes
Feb 13, 2011436 notes
Feb 13, 2011113 notes

almenarts said: Se ve arrechisimo!! Cuando se puede jugar un demo :D??

Aquí =)

http://www.gwenthemagicnanny.com/

Feb 12, 2011
Feb 12, 201123,126 notes
Feb 12, 20113 notes
#manugames #spaceinvaders #unmanuel
Feb 12, 20114 notes
#manugames #tetris #unmanuel
Feb 12, 201164 notes
Feb 12, 20113 notes
#robocop #Ed209 #dickjones #PaulVerhoeven
Feb 12, 20118 notes
#nintendo #redring #xbox360 #nes
Feb 12, 20113 notes
#manugames #unmanuel
Feb 12, 20111 note
#manugames #unmanuel
Feb 12, 2011119 notes
Evangelion 2.0 = PUPÚ CON CEBOLLA.
Feb 12, 2011
Feb 12, 201134 notes
#ayamikojima #art
Next page →
2012 2013
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
2011 2012 2013
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
2010 2011 2012
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
2010 2011
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December