#Mirror an Image

1 messages · Page 1 of 1 (latest)

pale cipher
#

I was wondering how I can mirror a BufferedImage vertically.
For example if I were to have a Player character for a game and it's image is facing to the right but now I want him to face to the left, how do I do that?

swift grailBOT
#

<@&987246399047479336> please have a look, thanks.

swift grailBOT
#

While you are waiting for getting help, here are some tips to improve your experience:

Code is much easier to read if posted with syntax highlighting and proper formatting.

If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.

Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.

modest agate
#

Look into AffineTransform

pale cipher
modest agate
#
AffineTransform at = AffineTransform.getScaleInstance(1, -1);
at.translate(0, -bufferedImage.getHeight(null));

BufferedImage mirrored = new AffineTransformOp(at, AffineTransformOp.TYPE_NEAREST_NEIGHBOR).filter(bufferedImage, null);```
#

Something like that

#

@pale cipher

swift grailBOT
#

Closed the thread due to inactivity.

If your question was not resolved yet, feel free to just post a message to reopen it, or create a new thread. But try to improve the quality of your question to make it easier to help you 👍

pale cipher
#

thanks