diff --git a/src/TextToImage.php b/src/TextToImage.php
index 0df948f..97f881a 100644
--- a/src/TextToImage.php
+++ b/src/TextToImage.php
@@ -167,7 +167,7 @@ public function render(string $save_as = null, string $ext = null): string
      */
     private function getExtension(string $filename): string
     {
-        return (($position = strrpos($filename,'.')) !== false) ? substr($filename,$position + 1) : '';
+        return (($position = strrpos($filename,'.')) !== false) ? mb_strtolower(substr($filename,$position + 1)) : '';
     }
 
     /**
@@ -215,4 +215,4 @@ private function write($image, Text $text, int $x, int $y, array $color)
             imagestring($image, $font_size, $x, $y, $label, imagecolorallocatealpha($image, ...$color));
         }
     }
-}
\ No newline at end of file
+}