How can PHP developers optimize resource usage when loading images from local filesystems?

When loading images from local filesystems in PHP, developers can optimize resource usage by using functions like `file_get_contents()` and `base64_encode()` to reduce the number of file reads and improve performance.

// Load image from local filesystem and encode it as base64
$image_path = 'path/to/image.jpg';
$image_data = file_get_contents($image_path);
$image_base64 = base64_encode($image_data);

// Display the image on a webpage
echo '<img src="data:image/jpeg;base64,' . $image_base64 . '" />';