If you wish for me to spoon feed you with code, here it is: PHP: private function setSkinForPlayerFromPng(Player $player, string $imagePath) { $ACCEPTED_SKIN_SIZES = [ 64 * 32 * 4, 64 * 64 * 4, 128 * 128 * 4 ]; $SKIN_WIDTH_MAP = [ 64 * 32 * 4 => 64, 64 * 64 * 4 => 64, 128 * 128 * 4 => 128 ]; $SKIN_HEIGHT_MAP = [ 64 * 32 * 4 => 32, 64 * 64 * 4 => 64, 128 * 128 * 4 => 128 ]; $image = imagecreatefrompng($imagePath); if ($image === false) { // Wasn't able to load image return; } $size = imagesx($image) * imagesy($image) * 4; if(!in_array($size, $ACCEPTED_SKIN_SIZES)) { // Image isn't skin sized return; } $width = $SKIN_WIDTH_MAP[$size]; $height = $SKIN_HEIGHT_MAP[$size]; $skinData = ""; for ($y = 0; $y < $height; $y++) { for ($x = 0; $x < $width; $x++) { // https://www.php.net/manual/en/function.imagecolorat.php $rgba = imagecolorat($image, $x, $y); $a = (127 - (($rgba >> 24) & 0x7F)) * 2; $r = ($rgba >> 16) & 0xff; $g = ($rgba >> 8) & 0xff; $b = $rgba & 0xff; $skinData .= chr($r) . chr($g) . chr($b) . chr($a); } } imagedestroy($image); $player->setSkin(new Skin($player->getSkin()->getSkinId(), $skinData)); $player->sendSkin();}