Well wherever you had g.addRenderingHints(), use buffer.createGraphics() instead of g.
Also
Sorry, yes that method works fine, for some reason I was under the impression that the method I recommended was the one, although I just checked and it is actually the inverse option! whoops