Custom image style conversion - how to read back from a file?
Here's how I did it.

public function applyEffect(ImageInterface $image) {

    // Save the image and process it externally...
    $some_tempoaray_filename = '/tmp/foo';
    $image-&gt;save($some_tempoaray_filename);
    call_some_external_process($some_tempoaray_filename);

    $toolkit = \Drupal::service('image.toolkit.manager')-&gt;getDefaultToolkit();
    // Re-call the existing Image object's constructor with the name of the
    // new file.
    $image-&gt;__construct($toolkit, $some_tempoaray_filename);
    // Next we have to make sure it loads the file into memory
    // because $image-&gt;save() requires it to be loaded, but this
    // happens outside of this function and we want to delete 
    // the $some_tempoaray_filename so as not to leave temp files.
    $toolkit-&gt;getResource(); // forces a load.
    // Now we can lose our temporary file.
    unlink($some_tempoaray_filename);

    return TRUE;
}