public static function convertGDRessourceToImagick($imgRessource, $png = false)
  {
    ob_start();
    if ($png) {
      imagepng($imgRessource, null, 0);
    } else {
      imagejpeg($imgRessource, null, 100);
    }
    $blob = ob_get_clean();

    $image = new \Imagick();
    $image->readImageBlob($blob);

    return $image;
  }