Is it possible to reverse WordPress thumbnail box resizing?

An example: say you have set the thumbnail size in WordPress to 200px/200px without cropping. If you upload an image that is 600px/300px it will be resized to 200px/100px. In other words it is resized to fit within the defined thumbnail dimensions, similar to the CSS background-size: contain; property.

What I’d actually like is to shrink the uploaded image as much as possible to fill the defined thumbnail, similar to the CSS background-size: cover; property. So my 600px/300px image would be resized to 400px/200px.

I don’t want to implement a CSS fix for this; I’m hoping to find a solution I can implement in WordPress so that my images are actually resized as I’ve described. I’m currently defining two alternative thumbnail sizes and them comparing them before outputting them, but I’d prefer to have a solution that doesn’t require the extra image files. The code I’m using works like this:

add_image_size('thumbnail_wide', 0, 250, false);
add_image_size('thumbnail_tall', 250, 0, false);

and later:

$thumbnail_tall = wp_get_attachment_image_src($attachment->ID, 'thumbnail_tall');
$thumbnail_wide = wp_get_attachment_image_src($attachment->ID, 'thumbnail_wide');

if ($thumbnail_wide[1] >= 200 && $thumbnail_wide[2] >= 200) {
  $attachment_data['thumbnail'] = $thumbnail_wide;
} else {
  $attachment_data['thumbnail'] = $thumbnail_tall;
}