Displaying raster image from .bin files

If I want to add a functionality where a user can upload .bin files that contain raster data, what are steps I would need to take to decode the data in the .bin files and translate it to some visual element that the user can see?

@Abe1 A .bin file extension indicates a “binary” file (generally meaning that it does not contain any human-readable text), but beyond that it doesn’t suggest any format in particular. Do you have more information about what these .bin files contain?