Skip to content

Commit

Permalink
Retitled StaineGlass -> Impressionist
Browse files Browse the repository at this point in the history
  • Loading branch information
davecom committed Jun 6, 2024
1 parent 6d0ddce commit c526bfc
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions StainedGlass/__main__.py → Impressionist/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# StainedGlass/__main__.py
# Impressionist/__main__.py
# From Fun Computer Science Projects in Python
# Copyright 2024 David Kopec
#
Expand All @@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from argparse import ArgumentParser
from StainedGlass.stainedglass import StainedGlass, ColorMethod, ShapeType
from Impressionist.impressionist import Impressionist, ColorMethod, ShapeType

if __name__ == "__main__":
# Parse the file argument
Expand All @@ -39,5 +39,5 @@
arguments = argument_parser.parse_args()
method = ColorMethod[arguments.method.upper()]
shape_type = ShapeType[arguments.shape.upper()]
StainedGlass(arguments.image_file, arguments.output_file, arguments.trials, method,
Impressionist(arguments.image_file, arguments.output_file, arguments.trials, method,
shape_type, arguments.length, arguments.vector, arguments.animate)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# StainedGlass/stainedglass.py
# Impressionist/impressionist.py
# From Fun Computer Science Projects in Python
# Copyright 2024 David Kopec
#
Expand All @@ -19,7 +19,7 @@
import random
from math import trunc
from timeit import default_timer as timer
from StainedGlass.svg import SVG
from Impressionist.svg import SVG

ColorMethod = Enum("ColorMethod", "RANDOM AVERAGE COMMON")
ShapeType = Enum("ShapeType", "ELLIPSE TRIANGLE QUADRILATERAL LINE")
Expand All @@ -32,7 +32,7 @@ def get_most_common_color(image: Image.Image) -> tuple[int, int, int]:
return max(colors, key=lambda item: item[0])[1] # type: ignore


class StainedGlass:
class Impressionist:
def __init__(self, file_name: str, output_file: str, trials: int, method: ColorMethod,
shape_type: ShapeType, length: int, vector: bool, animation_length: int):
self.method = method
Expand Down
2 changes: 1 addition & 1 deletion StainedGlass/svg.py → Impressionist/svg.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# StainedGlass/svg.py
# Impressionist/svg.py
# From Fun Computer Science Projects in Python
# Copyright 2024 David Kopec
#
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Additional options:

`-g` output a .gif format version as well

### StainedGlass (Chapter 4)
### Impressionist (Chapter 4)

Computationally draws abstract approximations of images using vector shapes.

Expand All @@ -82,11 +82,11 @@ Computationally draws abstract approximations of images using vector shapes.

#### Running

`python -m StainedGlass <input_file_name> <output_file_name>`
`python -m Impressionist <input_file_name> <output_file_name>`

For example:

`python -m StainedGlass swing.jpeg swing.png`
`python -m Impressionist swing.jpeg swing.png`

Additional options:

Expand Down

0 comments on commit c526bfc

Please sign in to comment.