There are 3 problems in the code:
1) Replace
Image image = makeColorTransparent(source, new Color(color), new Color(255, 0, 0));
with
Image image = makeColorTransparent(source, color, new Color(255, 0, 0));
and
public static Image makeColorTransparent(BufferedImage im, final Color search, final Color replace) { ... if (rgb == search.getRGB()) { ... }
with
public static Image makeColorTransparent(BufferedImage im, final int search, final Color replace) { ... if (rgb == search) { ... }
BECAUSE for some reason source.getRGB(0, 0) ignores the alpha value and turns white ((255, 255, 255, 0) becomes (255, 255, 255, 255))
2) You cannot use int color = source.getRGB(0, 0) because it uses the color of the first pixel (transparent). You should use some other code (for example, request a color in the console) to find out which pixel color to store in int color
3) You clear the color of the BufferedImage bufferedImage in imageToBufferedImage(...) with Color.BLACK (default). Replace //g2.setBackground(Color.blue); on g2.setBackground(new Color(0, 0, 0, 0)); or delete g2.clearRect(...);