Ads keep us online. Without them, we wouldn't exist. We don't have paywalls or sell mods - we never will. But every month we have large bills and running ads is our only way to cover them. Please consider unblocking us. Thank you from GameBanana <3

How to dither sprites without needing Paint.net

A Tutorial for Baldi's Basics in Education and Learning

Members see zero ads. Membership is 100% free

Glad i found this lol

--BACKSTORY--
Ahh a new tutorial here it's been some time since i did one. So basically I was messing around with google on my pc and found a new way to dither without having Paint
.net . Paint.net is a $7 thing (i think) and I dont like spending money on stuff like that.
So after the backstory i will now show you

How to dither sprites without needing Paint.net!
____________________________________

1. Download ImageJ, -> https://imagej.nih.gov/ij/download.html
(Link to the download site)

2. Extract the file (this will be important later)

3. Make a text document and name it "Dithering_.txt" and then after that open the text document and paste this code in it then save.

// Dithering
// G. Landini at bham. ac. uk
// 17/ May 2009
 
Dialog.create("Dithering");
items=newArray("Floyd-Steinberg", "Atkinson", "Jarvis-Judice-Ninke","Stucki",
        "Bayer_2x2", "Bayer_4x4", "Bayer_8x8", "Clustered_4x4", "Random");
doColour = false;
 
Dialog.addChoice("Method", items);
if (bitDepth==24) Dialog.addCheckbox("Colour dithering", false);
Dialog.show() ;
method=Dialog.getChoice();
if (bitDepth==24)
   doColour=Dialog.getCheckbox();
 
setBatchMode(true);
w=getWidth();
h=getHeight();
run("Duplicate...", "title="+method);
if (bitDepth == 24 && doColour) {
   run("RGB Stack");
   for (i=1; i<4; i++){
     showProgress(i/4);
     setSlice(i);
     dither(method);
   }
   run("RGB Color");
}
else{
  if (bitDepth>8 && !doColour) run("8-bit");
  dither(method);
}
setBatchMode(false);
 
function dither(method) {
 if (method=="Floyd-Steinberg"){
  w1=7/16;
  w2=3/16;
  w3=5/16;
  w4=1/16;
  for (y=0; y    for (x=0; x      oldpixel = getPixel(x,y);
      if (oldpixel<128) newpixel=0; else newpixel=255;
      setPixel(x,y, newpixel);
      quant_error = oldpixel - newpixel;
      setPixel(x+1,y, getPixel(x+1,y) + w1 * quant_error);
      setPixel(x-1,y+1, getPixel(x-1,y+1) + w2 * quant_error);
      setPixel(x,y+1, getPixel(x,y+1) + w3 * quant_error);
      setPixel(x+1,y+1, getPixel(x+1,y+1) + w4 * quant_error);
    }
  }
 }
 else if (method=="Atkinson"){
  w1=1/8;
  for (y=0; y    for (x=0; x      oldpixel = getPixel(x,y);
      if (oldpixel<128) newpixel = 0; else newpixel=255;
      setPixel(x,y, newpixel);
      quant_error = oldpixel - newpixel;
      setPixel(x+1,y, getPixel(x+1,y) + w1 * quant_error);
      setPixel(x+2,y, getPixel(x+2,y) + w1 * quant_error);
      setPixel(x-1,y+1, getPixel(x-1,y+1) + w1 * quant_error);
      setPixel(x,y+1, getPixel(x,y+1) + w1 * quant_error);
      setPixel(x+1,y+1, getPixel(x+1,y+1) + w1 * quant_error);
      setPixel(x,y+2, getPixel(x,y+2) + w1 * quant_error);
    }
  }
 }
 else if (method=="Jarvis-Judice-Ninke"){
  w7=7/48;
  w5=5/48;
  w3=3/48;
  w1=1/48;
  for (y=0; y    for (x=0; x      oldpixel = getPixel(x,y);
      if (oldpixel<128) newpixel = 0; else newpixel=255;
      setPixel(x,y, newpixel);
      quant_error = oldpixel - newpixel;
      setPixel(x+1,y, getPixel(x+1,y) + w7 * quant_error);
      setPixel(x+2,y, getPixel(x+2,y) + w5 * quant_error);
      setPixel(x-2,y+1, getPixel(x-2,y+1) + w3 * quant_error);
      setPixel(x-1,y+1, getPixel(x-1,y+1) + w5 * quant_error);
      setPixel(x,y+1, getPixel(x,y+1) + w7 * quant_error);
      setPixel(x+1,y+1, getPixel(x+1,y+1) + w5 * quant_error);
      setPixel(x+2,y+1, getPixel(x+2,y+1) + w3 * quant_error);
      setPixel(x-2,y+2, getPixel(x-2,y+2) + w1 * quant_error);
      setPixel(x-1,y+2, getPixel(x-1,y+2) + w3 * quant_error);
      setPixel(x,y+2, getPixel(x,y+2) + w5 * quant_error);
      setPixel(x+1,y+2, getPixel(x+1,y+2) + w3 * quant_error);
      setPixel(x+2,y+2, getPixel(x+2,y+2) + w1 * quant_error);
    }
  }
 }
 else if (method=="Stucki"){
  w8= 8/42;
  w7=7/42;
  w5=5/42;
  w4= 4/42;
  w2=2/42;
  w1=1/42;
  for (y=0; y    for (x=0; x      oldpixel = getPixel(x,y);
      if (oldpixel<128) newpixel = 0; else newpixel=255;
      setPixel(x,y, newpixel);
      quant_error = oldpixel - newpixel;
      setPixel(x+1,y, getPixel(x+1,y) + w7 * quant_error);
      setPixel(x+2,y, getPixel(x+2,y) + w5 * quant_error);
      setPixel(x-2,y+1, getPixel(x-2,y+1) + w2 * quant_error);
      setPixel(x-1,y+1, getPixel(x-1,y+1) + w4 * quant_error);
      setPixel(x,y+1, getPixel(x,y+1) + w8 * quant_error);
      setPixel(x+1,y+1, getPixel(x+1,y+1) + w4 * quant_error);
      setPixel(x+2,y+1, getPixel(x+2,y+1) + w2 * quant_error);
      setPixel(x-2,y+2, getPixel(x-2,y+2) + w1 * quant_error);
      setPixel(x-1,y+2, getPixel(x-1,y+2) + w2 * quant_error);
      setPixel(x,y+2, getPixel(x,y+2) + w4 * quant_error);
      setPixel(x+1,y+2, getPixel(x+1,y+2) + w2 * quant_error);
      setPixel(x+2,y+2, getPixel(x+2,y+2) + w1 * quant_error);
    }
  }
 }
 else if (method=="Bayer_2x2"){
  d= newArray(2,3,4,1);
  for (i=0; i    d[i]=d[i] * 64 - 1;
 
  for (y=0; y    for (x=0; x      if (getPixel(x,y)>=d[(y%2*2+x%2)])
          newpixel = 255;
      else
          newpixel=0;
      setPixel(x,y, newpixel);
    }
  }
 }
 else if (method=="Bayer_4x4"){
  d= newArray(0.1250, 1.0000, 0.1875, 0.8125, 0.6250, 0.3750, 0.6875,
     0.4375,0.2500, 0.8750, 0.0625, 0.9375, 0.7500, 0.5000, 0.5625, 0.3125);
  for (i=0; i    d[i]*=255;
  for (y=0; y    for (x=0; x      if (getPixel(x,y)>=d[(y%4*4+x%4)])
          newpixel = 255;
      else
          newpixel = 0;
      setPixel(x,y, newpixel);
    }
  }
 }
 else if (method=="Bayer_8x8"){
  d= newArray(1, 33,  9, 41, 3,  35, 11, 43, 49, 17, 57, 25, 51, 19, 59, 27, 13, 45, 5,
    37, 15, 47, 7, 39, 61, 29, 53, 21, 63, 31, 55, 23, 4, 36, 12, 44, 2, 34, 10, 42, 52,
    20, 60, 28, 50, 18, 58, 26, 16, 48, 8, 40, 14, 46, 6, 38, 64, 32, 56, 24, 62, 30,
    54, 22);
 
  for (i=0; i    d[i]=d[i] * 4 - 1;
 
  for (y=0; y    for (x=0; x      if (getPixel(x,y)>=d[(y%8*8+x%8)])
          newpixel = 255;
      else
          newpixel = 0;
      setPixel(x,y, newpixel);
 
    }
  }
 }
 else if (method=="Clustered_4x4"){
  d= newArray(0.7500, 0.3750, 0.6250, 0.2500, 0.0625, 1.0000, 0.8750, 0.4375,
    0.5000, 0.8125, 0.9375, 0.1250, 0.1875, 0.5625, 0.3125, 0.6875);
  for (i=0; i    d[i]*=255;
 
  for (y=0; y    for (x=0; x      if (getPixel(x,y)>=d[(y%4*4+x%4)])
          newpixel = 255;
      else
          newpixel = 0;
      setPixel(x,y, newpixel);
    }
  }
 }
else if (method=="Random"){
  w1=1/8;
  for (y=0; y    for (x=0; x      if(getPixel(x,y)> random*255)
        setPixel(x,y, 255);
      else  
        setPixel(x,y, 0);
    }
  }
 }
}

4. Now open your extracted ImageJ folder and there should be a folder called "plugins" open that

5. If you open the plugins folder there should multiple other folders, now simply drag your text document into one of the plugin folders (Note: Make sure the folder you dragged it in is a plugin in the actual application)

6. Now if you open ImageJ there should be a mew option (wherever you put the document in)

Now after we got that out of the way i'll give you a bonus tutorial

How to use the dithering plugin!
_________________________________

1. Before you can use the plugin you need to first open a file to use the plugin on. Just simply go to File -> Open -> Select your file

2. Now go to the plugin that has your dithering option

3. There should be a new window showing you 2 things
    1. A option of which dithering type you want to do (I use Floyd personally)
    2. An option to color the dithered sprite (select this unless you like Black, grey and white)
Simply just pick your type and then check the "Colour Dithering" box (again unless you want black grey and white)
 
4. Now after that it will do the dithering and then after you think it's done just go to File -> Save As.. and then I would recommand .png

Finally it's finished! Thanks for seeing my tutorial! I spent some time and research making this so liking and supporting this would be make me very happy!

Comments

Sign up to access this!

Embed

menu
Share banner
Image URL
HTML embed code
BB embed code
Markdown embed code

Credits

Me
RealT5mpler
RealT5mpler Joined 4mo ago
Offline
143 points Ranked 61299th
With the tutorial

Submitter

RealT5mpler avatar
RealT5mpler Joined 4mo ago
Not on right ok
143 points Ranked 61299th
RealT5mpler
Creator
  • Paypal Donate
Sign up to access this!
Sign up to access this!
Sign up to access this!

Game

Sign up to access this!

Category

Details

Difficulty Level
Beginner

Attributes

Share

  • Share on Reddit
  • Share on Twitter
  • Share on Facebook
  • favorite 0
  • remove_red_eye 489
  • mode_comment 8
  • access_time 22d

More from Submitter

menu

More Other/Misc Tutorials