mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-21 12:50:27 +08:00
Remove from_path and from_array methods
Having these methods and the constructor arguments is a bit redundant.
This commit is contained in:
@@ -309,23 +309,6 @@ class Picture(object):
|
||||
self._modified = False
|
||||
self.scale = 1
|
||||
|
||||
@staticmethod
|
||||
def from_path(path):
|
||||
"""Creates a Picture from an image file.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
path : str
|
||||
Path to the image file.
|
||||
|
||||
Returns
|
||||
-------
|
||||
pic : Picture
|
||||
A Picture with the image file data loaded.
|
||||
|
||||
"""
|
||||
return Picture(path=path)
|
||||
|
||||
@staticmethod
|
||||
def from_size(size, color='black'):
|
||||
"""Return a Picture of the specified size and a uniform color.
|
||||
@@ -344,26 +327,6 @@ class Picture(object):
|
||||
array = np.ones(rgb_size, dtype=np.uint8) * color
|
||||
return Picture(array=array)
|
||||
|
||||
@staticmethod
|
||||
def from_array(array):
|
||||
"""Creates a single color Picture.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
color : tuple
|
||||
RGB tuple with the fill color for the picture [0-255]
|
||||
|
||||
size : tuple
|
||||
Width and height of the picture in pixels.
|
||||
|
||||
Returns
|
||||
-------
|
||||
pic : Picture
|
||||
A Picture with the given color and size.
|
||||
|
||||
"""
|
||||
return Picture(array=array)
|
||||
|
||||
def save(self, path):
|
||||
"""Saves the picture to the given path.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user