@ilya_user The issue you're experiencing is most likely caused by the fact that you're trying to save the image with the same filename but with a different extension. The save method overwrites the existing file, so if you're trying to save the image with the same filename, it will save the image with the same format, not the format you're trying to change it to.
One solution to this would be to change the filename when you're saving the image after encoding it. For example, you can change the filename to include the new extension.
$img->encode('jpg', 80)->save('images/'. date('YmdHis') . '.jpg');
Another solution is to remove the file before saving the new one with the correct format
unlink('images/'. $employee_image);
$img->encode('jpg', 80)->save('images/'. $employee_image);
Sidenote: Also, make sure that you have the permissions to write in the specified directory.