$image = new Imagick('path/to/image.jpg'); $geometry = $image->getImageGeometry(); echo 'Width: '.$geometry['width'].'pxThis code will open an image and retrieve its dimensions using the getImageGeometry method. It then outputs the width and height in pixels. The Imagick library is a package for image processing in PHP.
'; echo 'Height: '.$geometry['height'].'px';