diff --git a/README.md b/README.md
index c353320..13b67e0 100644
--- a/README.md
+++ b/README.md
@@ -27,7 +27,8 @@ these requirements.
   This will download both the ImageMagick module and any dependent package.
 
 * Enable the module. Navigate to _Manage > Extend_. Check the box next to the
-  ImageMagick module and then click the 'Install' button at the bottom. If any dependent module is not already installed, the system will prompt you
+  ImageMagick module and then click the 'Install' button at the bottom. If any
+  dependent module is not already installed, the system will prompt you
   to confirm installing it too. Just confirm and proceed.
 
 # Configuration
@@ -38,6 +39,8 @@ these requirements.
 * Select the graphics package (ImageMagick or GraphicsMagick) you want to use
   with the toolkit.
 
+* For ImageMagick, select which version of the suite is installed, 6 or 7.
+
 * If the convert binary cannot be found in the default shell path, you must
   enter the path to the executables, including the trailing slash/backslash.
 
diff --git a/config/install/imagemagick.settings.yml b/config/install/imagemagick.settings.yml
index 290559e..98d0e86 100644
--- a/config/install/imagemagick.settings.yml
+++ b/config/install/imagemagick.settings.yml
@@ -1,5 +1,6 @@
 quality: 75
 binaries: 'imagemagick'
+imagemagick_version: 'v6'
 path_to_binaries: ''
 prepend: ''
 log_warnings: TRUE
diff --git a/config/schema/imagemagick.schema.yml b/config/schema/imagemagick.schema.yml
index ad4102c..049c196 100644
--- a/config/schema/imagemagick.schema.yml
+++ b/config/schema/imagemagick.schema.yml
@@ -11,6 +11,9 @@ imagemagick.settings:
     binaries:
       type: string
       label: 'Graphics package - ImageMagick/GraphicsMagick'
+   imagemagick_version:
+     type: string
+     label: 'ImageMagick version'
     path_to_binaries:
       type: string
       label: 'Path to the binaries'
diff --git a/imagemagick.install b/imagemagick.install
index 91e37e0..42a16ff 100644
--- a/imagemagick.install
+++ b/imagemagick.install
@@ -112,3 +112,13 @@ function imagemagick_update_8305() {
     ->clear('locale')
     ->save(TRUE);
 }
+
+/**
+ * Adds the 'imagemagick_version' config setting.
+ */
+function imagemagick_update_8306() {
+  $config_factory = \Drupal::configFactory();
+  $config_factory->getEditable('imagemagick.settings')
+    ->set('imagemagick_version', 'v6')
+    ->save(TRUE);
+}
diff --git a/src/ImagemagickExecManager.php b/src/ImagemagickExecManager.php
index ceb5256..e54e85b 100644
--- a/src/ImagemagickExecManager.php
+++ b/src/ImagemagickExecManager.php
@@ -112,10 +112,18 @@ class ImagemagickExecManager implements ImagemagickExecManagerInterface {
     return $packageSuite ? $packageSuite->label() : $package;
   }
 
+  public function getPackageSuiteVersion(?PackageSuite $packageSuite = NULL): string {
+    $packageSuite = $packageSuite ?: $this->getPackageSuite();
+    return match ($packageSuite) {
+      PackageSuite::Imagemagick => $this->configFactory->get('imagemagick.settings')->get('imagemagick_version') ?? 'v6',
+      PackageSuite::Graphicsmagick => 'v1',
+    };
+  }
+
   /**
    * {@inheritdoc}
    */
-  public function checkPath(string $path, string|PackageSuite|null $packageSuite = NULL): array {
+  public function checkPath(string $path, ?PackageSuite $packageSuite = NULL, ?string $packageSuiteVersion = NULL): array {
     if (is_string($packageSuite)) {
       @trigger_error('Passing a string value for $packageSuite in ' . __METHOD__ . '() is deprecated in imagemagick:8.x-3.7 and is removed from imagemagick:4.0.0. Use PackageSuite instead. See https://www.drupal.org/node/3409315', E_USER_DEPRECATED);
       $packageSuite = PackageSuite::from($packageSuite);
@@ -126,10 +134,15 @@ class ImagemagickExecManager implements ImagemagickExecManagerInterface {
       'errors' => [],
     ];
 
-    // Execute gm or convert based on settings.
-    $packageSuite = $packageSuite ?: $this->getPackageSuite();
+    // Execute gm, convert or magick based on settings.
+    $packageSuite ??= $this->getPackageSuite();
+    $packageSuiteVersion ??= $this->getPackageSuiteVersion($packageSuite);
+
     $binary = match ($packageSuite) {
-      PackageSuite::Imagemagick => 'convert',
+      PackageSuite::Imagemagick => match ($packageSuiteVersion) {
+        'v7' => 'magick',
+        default => 'convert',
+      },
       PackageSuite::Graphicsmagick => 'gm',
     };
     $executable = $this->getExecutable($binary, $path);
@@ -165,7 +178,10 @@ class ImagemagickExecManager implements ImagemagickExecManagerInterface {
     // Unless we had errors so far, try to invoke convert.
     if (!$status['errors']) {
       $error = NULL;
-      $this->runProcess([$executable, '-version'], $packageSuite->value, $status['output'], $error);
+      $returnCode = $this->runProcess([$executable, '-version'], $packageSuite->value, $status['output'], $error);
+      if (empty($error) && $returnCode === 127) {
+        $error = $executable . ': command not found.';
+      }
       if ($error !== '') {
         $status['errors'][] = $error;
       }
@@ -183,11 +199,15 @@ class ImagemagickExecManager implements ImagemagickExecManagerInterface {
       $command = PackageCommand::tryFrom($command);
     }
     $packageSuite = $this->getPackageSuite();
+    $packageSuiteVersion ??= $this->getPackageSuiteVersion($packageSuite);
 
     $cmdline = [];
 
     $binary = match ($packageSuite) {
-      PackageSuite::Imagemagick => $command->value,
+      PackageSuite::Imagemagick => match ($packageSuiteVersion) {
+        'v7' => 'magick',
+        default => $command->value,
+      },
       PackageSuite::Graphicsmagick => 'gm',
     };
 
@@ -210,9 +230,10 @@ class ImagemagickExecManager implements ImagemagickExecManagerInterface {
     }
 
     if ($command === PackageCommand::Identify) {
-      // ImageMagick syntax: identify [arguments] source.
+      // ImageMagick v6 syntax: identify [arguments] source.
+      // ImageMagick v7 syntax: magick identify [arguments] source.
       // GraphicsMagick syntax: gm identify [arguments] source.
-      if ($packageSuite === PackageSuite::Graphicsmagick) {
+      if ($binary !== 'identify') {
         $cmdline[] = 'identify';
       }
       array_push($cmdline, ...$arguments->toArray(ArgumentMode::PreSource));
@@ -267,7 +288,8 @@ class ImagemagickExecManager implements ImagemagickExecManagerInterface {
   /**
    * Builds a convert command for Imagemagick.
    *
-   * ImageMagick syntax: convert input [arguments] output.
+   * ImageMagick v6 syntax: convert input [arguments] output.
+   * ImageMagick v7 syntax: magick convert input [arguments] output.
    *
    * @param \Drupal\imagemagick\ImagemagickExecArguments $arguments
    *   An ImageMagick execution arguments object.
@@ -282,7 +304,10 @@ class ImagemagickExecManager implements ImagemagickExecManagerInterface {
    * @see http://www.imagemagick.org/Usage/basics/#cmdline
    */
   private function buildImagemagickConvertCommand(ImagemagickExecArguments $arguments, string $sourcePath, string $destinationPath): array {
-    $cmdline = [];
+    $cmdline = match ($this->getPackageSuiteVersion(PackageSuite::Imagemagick)) {
+      'v7' => ['convert'],
+      default => [],
+    };
     if (($pre = $arguments->toArray(ArgumentMode::PreSource)) !== []) {
       array_push($cmdline, ...$pre);
     }
diff --git a/src/ImagemagickExecManagerInterface.php b/src/ImagemagickExecManagerInterface.php
index 36541fe..9bb6047 100644
--- a/src/ImagemagickExecManagerInterface.php
+++ b/src/ImagemagickExecManagerInterface.php
@@ -30,13 +30,24 @@ interface ImagemagickExecManagerInterface {
   /**
    * Gets the binaries package in use.
    *
-   * @param string $package
+   * @param string|null $package
    *   (optional) Force the graphics package suite.
    *
    * @return \Drupal\imagemagick\PackageSuite
    *   The package suite.
    */
-  public function getPackageSuite(string $package = NULL): PackageSuite;
+  public function getPackageSuite(?string $package = NULL): PackageSuite;
+
+  /**
+   * Gets the version of the package in use.
+   *
+   * @param \Drupal\imagemagick\PackageSuite|null $packageSuite
+   *   (optional) Force the graphics package suite.
+   *
+   * @return string
+   *   The version of the package suite.
+   */
+  public function getPackageSuiteVersion(?PackageSuite $packageSuite = NULL): string;
 
   /**
    * Gets the binaries package in use.
@@ -77,8 +88,10 @@ interface ImagemagickExecManagerInterface {
    *
    * @param string $path
    *   The user-submitted file path to the convert binary.
-   * @param string|PackageSuite|null $package
+   * @param PackageSuite|null $package
    *   (optional) The graphics package to use.
+   * @param ?string $packageSuiteVersion
+   *   (optional) The graphics package version.
    *
    * @return array
    *   An associative array containing:
@@ -86,7 +99,7 @@ interface ImagemagickExecManagerInterface {
    *   - errors: A list of error messages indicating if the executable could
    *     not be found or executed.
    */
-  public function checkPath(string $path, string|PackageSuite|null $package = NULL): array;
+  public function checkPath(string $path, ?PackageSuite $package = NULL, ?string $packageSuiteVersion = NULL): array;
 
   /**
    * Executes the convert executable as shell command.
diff --git a/src/Plugin/ImageToolkit/ImagemagickToolkit.php b/src/Plugin/ImageToolkit/ImagemagickToolkit.php
index bfb4fac..b10e804 100644
--- a/src/Plugin/ImageToolkit/ImagemagickToolkit.php
+++ b/src/Plugin/ImageToolkit/ImagemagickToolkit.php
@@ -178,6 +178,22 @@ class ImagemagickToolkit extends ImageToolkitBase {
       '#required' => TRUE,
       '#description' => $this->t("Select the graphics package to use."),
     ];
+    $form['suite']['imagemagick_version'] = [
+      '#type' => 'radios',
+      '#title' => $this->t('ImageMagick version'),
+      '#default_value' => $config->get('imagemagick_version'),
+      '#options' => [
+        'v6' => $this->t('Version 6'),
+        'v7' => $this->t('Version 7'),
+        ],
+      '#required' => TRUE,
+      '#description' => $this->t("ImageMagick version 6 and version 7 have different command line syntax. Select the one installed."),
+      '#states' => [
+        'visible' => [
+          ':radio[name="imagemagick[suite][binaries]"]' => ['value' => PackageSuite::Imagemagick->value],
+        ],
+      ],
+    ];
     // Path to binaries.
     $form['suite']['path_to_binaries'] = [
       '#type' => 'textfield',
@@ -187,7 +203,9 @@ class ImagemagickToolkit extends ImageToolkitBase {
       '#description' => $this->t('If needed, the path to the package executables (<kbd>convert</kbd>, <kbd>identify</kbd>, <kbd>gm</kbd>, etc.), <b>including</b> the trailing slash/backslash. For example: <kbd>/usr/bin/</kbd> or <kbd>C:\Program Files\ImageMagick-6.3.4-Q16\</kbd>.'),
     ];
     // Version information.
-    $status = $this->getExecManager()->checkPath($this->configFactory->get('imagemagick.settings')->get('path_to_binaries'));
+    $status = $this->getExecManager()->checkPath(
+      $this->configFactory->get('imagemagick.settings')->get('path_to_binaries'),
+    );
     if (empty($status['errors'])) {
       $version_info = explode("\n", preg_replace('/\r/', '', Html::escape($status['output'])));
     }
@@ -386,9 +404,12 @@ class ImagemagickToolkit extends ImageToolkitBase {
     // it will prevent the entire image toolkit selection form from being
     // submitted.
     if ($form_state->getValue(['image_toolkit']) === 'imagemagick') {
-      $status = $this->getExecManager()->checkPath($form_state->getValue([
-        'imagemagick', 'suite', 'path_to_binaries',
-      ]), PackageSuite::from($form_state->getValue(['imagemagick', 'suite', 'binaries'])));
+      $suite = PackageSuite::from($form_state->getValue(['imagemagick', 'suite', 'binaries']));
+      $version = $suite === PackageSuite::Imagemagick ? $form_state->getValue(
+        ['imagemagick', 'suite', 'imagemagick_version'],
+      ) : NULL;
+      $path = $form_state->getValue(['imagemagick', 'suite', 'path_to_binaries']);
+      $status = $this->getExecManager()->checkPath($path, $suite, $version);
       if ($status['errors']) {
         $form_state->setErrorByName('imagemagick][suite][path_to_binaries', new FormattableMarkup(implode('<br />', $status['errors']), []));
       }
@@ -407,6 +428,9 @@ class ImagemagickToolkit extends ImageToolkitBase {
       ->set('binaries', (string) $form_state->getValue([
         'imagemagick', 'suite', 'binaries',
       ]))
+      ->set('imagemagick_version', (string) $form_state->getValue([
+        'imagemagick', 'suite', 'imagemagick_version',
+      ]))
       ->set('path_to_binaries', (string) $form_state->getValue([
         'imagemagick', 'suite', 'path_to_binaries',
       ]))
@@ -758,7 +782,9 @@ class ImagemagickToolkit extends ImageToolkitBase {
       ]);
     }
     else {
-      $status = $this->getExecManager()->checkPath($this->configFactory->get('imagemagick.settings')->get('path_to_binaries'));
+      $status = $this->getExecManager()->checkPath(
+        $this->configFactory->get('imagemagick.settings')->get('path_to_binaries'),
+      );
       if (!empty($status['errors'])) {
         // Can not execute 'convert'.
         $severity = REQUIREMENT_ERROR;
diff --git a/tests/src/Functional/ToolkitImagemagickFormTest.php b/tests/src/Functional/ToolkitImagemagickFormTest.php
index ae2a443..ccbd5bf 100644
--- a/tests/src/Functional/ToolkitImagemagickFormTest.php
+++ b/tests/src/Functional/ToolkitImagemagickFormTest.php
@@ -4,6 +4,8 @@ namespace Drupal\Tests\imagemagick\Functional;
 
 use Drupal\Core\Session\AccountInterface;
 use Drupal\image\Entity\ImageStyle;
+use Drupal\imagemagick\ImagemagickExecManagerInterface;
+use Drupal\imagemagick\PackageSuite;
 use Drupal\Tests\BrowserTestBase;
 use Drupal\user\Entity\Role;
 
@@ -84,6 +86,16 @@ class ToolkitImagemagickFormTest extends BrowserTestBase {
     $this->submitForm($edit, 'Save configuration');
     $this->assertSession()->fieldValueEquals('image_toolkit', 'imagemagick');
 
+    // Test Imagemagick 7 is recognized if available and selected.
+    $status = \Drupal::service(ImagemagickExecManagerInterface::class)->checkPath('', PackageSuite::Imagemagick, 'v7');
+    if (empty($status['errors'])) {
+      $edit = [
+        'imagemagick[suite][imagemagick_version]' => 'v7',
+      ];
+      $this->submitForm($edit, 'Save configuration');
+      $this->assertSession()->elementTextContains('css', 'details[data-drupal-selector="edit-imagemagick-suite-version"]', 'ImageMagick 7.');
+    }
+
     // Test default supported image extensions.
     $this->assertSession()->responseNotContains('Image format errors');
     $this->assertSession()->responseContains('GIF, JPEG, PNG');
diff --git a/tests/src/Kernel/ExecManagerTest.php b/tests/src/Kernel/ExecManagerTest.php
index 78b05e1..b717461 100644
--- a/tests/src/Kernel/ExecManagerTest.php
+++ b/tests/src/Kernel/ExecManagerTest.php
@@ -34,9 +34,8 @@ class ExecManagerTest extends KernelTestBase {
     $execManager = \Drupal::service(ImagemagickExecManagerInterface::class);
     $output = '';
     $error = '';
-    $expected = substr(PHP_OS, 0, 3) !== 'WIN' ? 127 : 1;
     $ret = $execManager->runOsShell('pinkpanther', '-inspector Clouseau', 'blake', $output, $error);
-    $this->assertEquals($expected, $ret, $error);
+    $this->assertTrue(in_array($ret, [1, 127], TRUE), $error);
   }
 
   /**
diff --git a/tests/src/Kernel/ToolkitSetupTrait.php b/tests/src/Kernel/ToolkitSetupTrait.php
index 0b02be3..755513d 100644
--- a/tests/src/Kernel/ToolkitSetupTrait.php
+++ b/tests/src/Kernel/ToolkitSetupTrait.php
@@ -83,11 +83,22 @@ trait ToolkitSetupTrait {
    */
   public static function providerToolkitConfiguration(): array {
     return [
-      'ImageMagick-imagemagick' => [
+      'ImageMagick-imagemagick-v6' => [
         'toolkit_id' => 'imagemagick',
         'toolkit_config' => 'imagemagick.settings',
         'toolkit_settings' => [
           'binaries' => 'imagemagick',
+          'imagemagick_version' => 'v6',
+          'quality' => 100,
+          'debug' => TRUE,
+        ],
+      ],
+      'ImageMagick-imagemagick-v7' => [
+        'toolkit_id' => 'imagemagick',
+        'toolkit_config' => 'imagemagick.settings',
+        'toolkit_settings' => [
+          'binaries' => 'imagemagick',
+          'imagemagick_version' => 'v7',
           'quality' => 100,
           'debug' => TRUE,
         ],
