This pull request improves the existing code by making it safer and more robust. The following changes were made:
Removed unnecessary comments that did not add value to the code.
Replaced the unsafe block in the new() function with a match expression to handle any errors that might occur.
Added error handling to the from() function to ensure that the input image has the expected number of rows and columns.
These changes improve the maintainability and reliability of the code.
Description
This pull request improves the existing code by making it safer and more robust. The following changes were made: