I want to antialiase an image with shape (plane) I draw in it. I draw the plane image in Adobe AI and put them in my resource folder. The image looks like below.
When I use this line of code
g2.drawImage(image, (int)x, (int)y, width, height, null);
to draw it on the screen, the edge becomes edgy.

I know there is a way to antialiase a g2d shape using renderingHints, but I am not sure if it worls on shape in the image...
So, any help is appreciated!
Full Code below:
package entity;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.ArrayList;
import javax.imageio.ImageIO;
import main.Game;
import main.GamePanel;
// Module HP
// Acceleration and speed
public class Player extends Plane{
private BufferedImage basic;
// acceleration vector lists
private final ArrayList<double[]> accelerations;
// rate of increasing speed
// 1.0 / (time to reach max speed in seconds) * FPS
private final double ACCCONST = 1.0/(0.5*Game.FPS);
// special attributes
//TEMP
private final ArrayList<Bullet> bullets;
public Player(GamePanel gp) {
this.loadImages();
this.gp = gp;
// set image
image = basic;
// basic attributes
x = Game.SPAWNX - width/2;
y = Game.SPAWNY - height;
// init lists
accelerations = new ArrayList<>();
//TEMP
bullets = new ArrayList<>();
}
private void loadImages() {
try {
basic = ImageIO.read(getClass().getResourceAsStream("/res/players/basic.png"));
} catch (IOException e) {
e.printStackTrace();
}
}
// setters
public void addAcceleration(double[] pair) {
if (pair.length == 2) {
accelerations.add(pair);
}
}
@Override
public void setEnginePower(double enginePower) {
this.enginePower = enginePower;
this.maxSpeed = enginePower;
}
@Override
public void setAtkSpeed(double atkSpeed) {
this.atkSpeed = atkSpeed;
if (atkSpeed == 0) atkInterval = (int)Double.POSITIVE_INFINITY;
else atkInterval = (int)(Game.FPS/atkSpeed);
}
// getters
// get movement info
private double[] getRAcceleration() {
// get resultant acceleration
xAPF = 0; yAPF = 0;
for (double[] pair: accelerations) {
if (pair.length == 2) {
xAPF += pair[0];
yAPF += pair[1];
}
}
accelerations.clear();
return new double[]{xAPF, yAPF};
}
private void move() {
double[] pair = this.getRAcceleration();
// no acceleration
if (pair[0] == 0 && pair[1] == 0) {
// reset speed to 0
if (xSPF > 0) xSPF = Math.max(xSPF - Game.DECELERATION, 0);
else if (xSPF < 0) xSPF = Math.min(xSPF + Game.DECELERATION, 0);
if (ySPF > 0) ySPF = Math.max(ySPF - Game.DECELERATION, 0);
else if (ySPF < 0) ySPF = Math.min(ySPF + Game.DECELERATION, 0);
}
// accleration exists
else {
// max speed = acceleration
if (xAPF > 0) xSPF = Math.min(xSPF + xAPF*ACCCONST, maxSpeed);
else xSPF = Math.max(xSPF + xAPF*ACCCONST, -maxSpeed);
if (yAPF > 0) ySPF = Math.min(ySPF + yAPF*ACCCONST, maxSpeed);
else ySPF = Math.max(ySPF + yAPF*ACCCONST, -maxSpeed);
}
// move
x += xSPF;
y += ySPF;
}
private void shoot() {
double spawnX = x + singleShootingScale * width;
double spawnY = y;
Bullet bullet = new Bullet(gp, this, spawnX, spawnY);
bullet.addAcceleration(new double[]{0, -10});
bullets.add(bullet);
}
private void getAFromKey() {
boolean[] keyPressed = gp.keyH.keyPressed;
if (keyPressed[0]) accelerations.add(new double[]{0, -enginePower / Game.FPS});
if (keyPressed[1]) accelerations.add(new double[]{-enginePower / Game.FPS, 0});
if (keyPressed[2]) accelerations.add(new double[]{0, enginePower / Game.FPS});
if (keyPressed[3]) accelerations.add(new double[]{enginePower / Game.FPS, 0});
}
@Override
public void update() {
// check all events
//TEMP
for (Bullet bullet: bullets) bullet.update();
// shoot
if (atkInterval == 0) this.shoot();
else if (frameCnt % atkInterval == 0) this.shoot();
this.getAFromKey();
this.move();
frameCnt += 1;
}
@Override
public void draw(Graphics2D g2) {
//TEMP
for (Bullet bullet: bullets) bullet.draw(g2);
g2.drawImage(image, (int)x, (int)y, width, height, null);
}
}
I have reviewed some past posts about this kind of problems but I did not find one that suits me [shape in image].
If there is no way to do it on java, perhaps it's the way I draw my art? (What's a better way to put art in Java game design)

Basically, redraw the image. I did something similar here. The key line is
Image scaledImg = img.getScaledInstance(scaleImage[0], scaleImage[1], Image.SCALE_SMOOTH);