2022.02.02.1
33
LICENSE
|
@ -1,18 +1,21 @@
|
|||
Copyright (c) 2021-2022 Ulbwazhine
|
||||
MIT License
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
software and associated documentation files (the "Software"), to deal in the Software
|
||||
without restriction, including without limitation the rights to use, copy, modify,
|
||||
merge, publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
and to permit persons to whom the Software is furnished to do so, subject to the
|
||||
following conditions:
|
||||
Copyright (c) 2022 ulbwazhine
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies
|
||||
or substantial portions of the Software.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
|
||||
OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
|
|
@ -2,11 +2,11 @@ import logging
|
|||
import os
|
||||
|
||||
from TemporaryStorage import TemporaryStorageInstance
|
||||
from importlib import import_module
|
||||
from typing import List
|
||||
from typing import List, Optional
|
||||
from PIL import Image
|
||||
|
||||
from MockupEngineer import templates
|
||||
from MockupEngineer.templates import Device, ALL_TEMPLATES
|
||||
from MockupEngineer.utils import random_string
|
||||
|
||||
generated_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'generated')
|
||||
|
@ -17,13 +17,14 @@ if not os.path.exists(generated_path):
|
|||
class MockupEngineerInstance:
|
||||
def __init__(self):
|
||||
self.logger = logging.getLogger('MockupEngineer')
|
||||
self.templates: List[templates.Template] = []
|
||||
self.templates: List[Device] = []
|
||||
self.storage = TemporaryStorageInstance()
|
||||
|
||||
for template in templates.ALL_TEMPLATES:
|
||||
self.templates.append(getattr(
|
||||
import_module(name='MockupEngineer.templates.' + template,
|
||||
package='MockupEngineer.templates.' + template + '.Device'), 'Device')())
|
||||
for template in ALL_TEMPLATES:
|
||||
try:
|
||||
self.templates.append(Device(template))
|
||||
except Exception as e:
|
||||
self.logger.warning('Failed to load "{}" module: {}'.format(template, e))
|
||||
|
||||
def __create_mockups_list__(self) -> str:
|
||||
output = list()
|
||||
|
@ -41,8 +42,8 @@ class MockupEngineerInstance:
|
|||
'ulbwazhine/MockupEngineer/main/MockupEngineer/'
|
||||
'templates/{path}/example.png) [{resolution}] ({year})'.format(
|
||||
manufacturer=template.manufacturer, name=template.name,
|
||||
path=template.__template_path__, resolution=template.resolution,
|
||||
year=template.year))
|
||||
path=os.path.basename(os.path.dirname(template.preview)),
|
||||
resolution=template.resolution, year=template.year))
|
||||
|
||||
for color in sorted(template.colors, key=lambda a: a.color):
|
||||
output.append(' * {}'.format(color.color))
|
||||
|
@ -53,25 +54,22 @@ class MockupEngineerInstance:
|
|||
|
||||
def __create_examples__(self, example_path: str) -> None:
|
||||
for template in self.templates:
|
||||
if os.path.isfile(template.example_path):
|
||||
os.remove(template.example_path)
|
||||
if os.path.isfile(template.preview):
|
||||
os.remove(template.preview)
|
||||
|
||||
mockup_path = self.generate(template, example_path, orientation='portrait')
|
||||
mockup_path = self.generate(template.id, example_path)
|
||||
mockup_img = Image.open(mockup_path)
|
||||
background_img = Image.new('RGBA', mockup_img.size, (255, 255, 255, 255))
|
||||
background_img.paste(mockup_img, (0, 0), mockup_img)
|
||||
|
||||
background_img.save(template.example_path)
|
||||
background_img.save(template.preview)
|
||||
|
||||
os.remove(mockup_path)
|
||||
|
||||
@staticmethod
|
||||
def resize(image: str, width: int, height: int) -> str:
|
||||
name = '{}/image{}.png'.format(generated_path, random_string(16))
|
||||
img = Image.open(image).resize((width, height), Image.ANTIALIAS)
|
||||
img.save(name)
|
||||
|
||||
return name
|
||||
def get_template(self, template_id: str) -> Optional[Device]:
|
||||
for template in self.templates:
|
||||
if template.id == template_id:
|
||||
return template
|
||||
|
||||
def get_templates(self) -> dict:
|
||||
dicted = dict()
|
||||
|
@ -82,52 +80,52 @@ class MockupEngineerInstance:
|
|||
dicted[template.type] = [template]
|
||||
return dicted
|
||||
|
||||
def generate(self, template: templates.Template,
|
||||
screenshot_path: str, color: str = None,
|
||||
orientation: str = None, external_storage: bool = False) -> str:
|
||||
if not orientation:
|
||||
img = Image.open(screenshot_path)
|
||||
width, height = img.size
|
||||
orientation = 'portrait' if height > width or height == width else 'landscape'
|
||||
def generate(self, template_id: str,
|
||||
screenshot_path: str,
|
||||
color: str = None,
|
||||
orientation: str = None,
|
||||
external_storage: bool = False) -> str:
|
||||
template = self.get_template(template_id)
|
||||
|
||||
if orientation == 'portrait':
|
||||
screen_width = template.__portrait_width__
|
||||
screen_height = template.__portrait_height__
|
||||
screen_x = template.__portrait_x__
|
||||
screen_y = template.__portrait_y__
|
||||
screen_mask = template.__portrait_mask__ if template.__use_mask__ else None
|
||||
else:
|
||||
screen_width = template.__landscape_width__
|
||||
screen_height = template.__landscape_height__
|
||||
screen_x = template.__landscape_x__
|
||||
screen_y = template.__landscape_y__
|
||||
screen_mask = template.__landscape_mask__ if template.__use_mask__ else None
|
||||
|
||||
resized_screenshot_path = self.resize(screenshot_path, screen_width, screen_height)
|
||||
if not template:
|
||||
raise ModuleNotFoundError('Module with id {} not found.'.format(template_id))
|
||||
|
||||
for template_color in template.colors:
|
||||
if template_color.color == color:
|
||||
template_path = template_color.portrait_path \
|
||||
if orientation == 'portrait' else template_color.landscape_path
|
||||
color = template_color
|
||||
break
|
||||
else:
|
||||
template_path = template.colors[-1].portrait_path \
|
||||
if orientation == 'portrait' else template.colors[-1].landscape_path
|
||||
color = template.colors[0]
|
||||
|
||||
mockup_path = '{}/mockup{}.png'.format(generated_path, random_string(16))
|
||||
template_image = Image.open(color.path).convert("RGBA")
|
||||
screenshot_image = Image.open(screenshot_path).convert("RGBA")
|
||||
placeholder_image = Image.new('RGBA', template_image.size, (0, 0, 0, 0))
|
||||
|
||||
template_img = Image.open(template_path)
|
||||
mask_img = Image.new('RGBA', template_img.size, (0, 0, 0, 0))
|
||||
screenshot_img = Image.open(resized_screenshot_path)
|
||||
mask_img.paste(screenshot_img, (screen_x, screen_y))
|
||||
mask_img.paste(template_img, (0, 0), template_img)
|
||||
screenshot_orientation = (
|
||||
'portrait' if screenshot_image.size[0] <= screenshot_image.size[1] else 'landscape'
|
||||
) if not orientation else orientation
|
||||
|
||||
if screen_mask:
|
||||
screen_mask = Image.open(screen_mask).convert('L')
|
||||
mask_img.putalpha(screen_mask)
|
||||
mask_img.save(mockup_path)
|
||||
template_orientation = (
|
||||
'portrait' if template.image.width <= template.image.height else 'landscape'
|
||||
)
|
||||
|
||||
os.remove(resized_screenshot_path)
|
||||
if screenshot_orientation != template_orientation and template.image.rotate:
|
||||
screenshot_image = screenshot_image.rotate(-90, expand=True)
|
||||
|
||||
screenshot_image = screenshot_image.resize((template.image.width, template.image.height), Image.ANTIALIAS)
|
||||
|
||||
placeholder_image.paste(screenshot_image, (template.image.x, template.image.y))
|
||||
placeholder_image.paste(template_image, (0, 0), template_image)
|
||||
|
||||
if template.image.mask:
|
||||
mask_image = Image.open(template.image.mask_path).convert('L')
|
||||
placeholder_image.putalpha(mask_image)
|
||||
|
||||
if screenshot_orientation != template_orientation and template.image.rotate:
|
||||
placeholder_image = placeholder_image.rotate(90, expand=True)
|
||||
|
||||
mockup_path = os.path.join(generated_path, 'mockup-{}.png'.format(random_string(16)))
|
||||
placeholder_image.save(mockup_path)
|
||||
|
||||
if not external_storage:
|
||||
return mockup_path
|
||||
|
|
|
@ -20,7 +20,7 @@ def main():
|
|||
print('- - - - - - - - - -')
|
||||
screenshot = input('Enter path to screenshot: ')
|
||||
print('- - - - - - - - - -\nWorking...')
|
||||
mockup = mockup.generate(template, screenshot, color, external_storage=True)
|
||||
mockup = mockup.generate(template.id, screenshot, color, external_storage=True)
|
||||
print('- - - - - - - - - -\nSuccess: {}'.format(mockup))
|
||||
os.system('open {}'.format(mockup))
|
||||
|
||||
|
|
|
@ -1,77 +1,73 @@
|
|||
import hashlib
|
||||
import os
|
||||
|
||||
from dataclasses import dataclass, field
|
||||
from configparser import ConfigParser
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
from typing import List
|
||||
from typing import Optional
|
||||
|
||||
templates_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'templates')
|
||||
|
||||
|
||||
def __list_all_templates():
|
||||
def __list_all_templates__():
|
||||
all_templates = [x.name for x in Path(templates_path).iterdir()
|
||||
if x.is_dir() and not str(x).startswith('__') and not str(x).endswith('__')]
|
||||
return all_templates
|
||||
|
||||
|
||||
ALL_TEMPLATES = sorted(__list_all_templates())
|
||||
ALL_TEMPLATES = sorted(__list_all_templates__())
|
||||
__all__ = ALL_TEMPLATES + ["ALL_TEMPLATES"]
|
||||
|
||||
|
||||
def default_factory_none() -> None:
|
||||
return None
|
||||
|
||||
|
||||
def default_factory_false() -> bool:
|
||||
return False
|
||||
@dataclass(frozen=False)
|
||||
class DeviceColor:
|
||||
color: str
|
||||
path: str
|
||||
|
||||
|
||||
@dataclass(frozen=False)
|
||||
class TemplateColor:
|
||||
color: str = ''
|
||||
portrait_path: str = field(default_factory=str)
|
||||
landscape_path: str = field(default_factory=str)
|
||||
|
||||
|
||||
class DeviceImage:
|
||||
width: int
|
||||
height: int
|
||||
x: int
|
||||
y: int
|
||||
mask: bool
|
||||
mask_path: Optional[str]
|
||||
rotate: bool
|
||||
|
||||
|
||||
@dataclass(frozen=False)
|
||||
class Template:
|
||||
manufacturer: str = field(default_factory=str)
|
||||
name: str = field(default_factory=str)
|
||||
type: str = field(default_factory=str)
|
||||
year: int = field(default_factory=int)
|
||||
resolution: str = field(default_factory=str)
|
||||
example_path: str = field(default_factory=str)
|
||||
class Device:
|
||||
def __init__(self, path: str):
|
||||
config = ConfigParser()
|
||||
config.read(os.path.join(templates_path, path, 'config.ini'))
|
||||
|
||||
colors: List[TemplateColor] = field(default_factory=list)
|
||||
self.id = hashlib.md5(str({s: dict(config.items(s)) for s in config.sections()}).encode()).hexdigest()
|
||||
self.manufacturer: str = str(config.get('info', 'manufacturer'))
|
||||
self.name: str = str(config.get('info', 'name'))
|
||||
self.type: str = str(config.get('info', 'type'))
|
||||
self.year: int = int(config.get('info', 'year'))
|
||||
self.width: int = int(config.get('info', 'width'))
|
||||
self.height: int = int(config.get('info', 'height'))
|
||||
self.resolution: str = '{width} x {height}'.format(
|
||||
width=self.width, height=self.height)
|
||||
self.preview: str = str(os.path.join(templates_path, path, 'preview.png'))
|
||||
|
||||
__template_path__: str = field(default_factory=str)
|
||||
__colors__: dict = field(default_factory=dict)
|
||||
self.colors = [DeviceColor(
|
||||
color=str(key).title(), path=str(os.path.join(templates_path, path, item))
|
||||
) for key, item in config['colors'].items()]
|
||||
|
||||
__use_mask__: bool = field(default_factory=default_factory_false)
|
||||
self.image = DeviceImage(
|
||||
width=int(config.get('image', 'width')),
|
||||
height=int(config.get('image', 'height')),
|
||||
x=int(config.get('image', 'x')),
|
||||
y=int(config.get('image', 'y')),
|
||||
mask=config.get('image', 'mask') == 'true',
|
||||
mask_path=os.path.join(templates_path, path, 'mask.png') if config.get('image', 'mask') == 'true' else None,
|
||||
rotate=config.get('image', 'rotate') == 'true')
|
||||
|
||||
__portrait_width__: int = field(default_factory=int)
|
||||
__portrait_height__: int = field(default_factory=int)
|
||||
__portrait_x__: int = field(default_factory=int)
|
||||
__portrait_y__: int = field(default_factory=int)
|
||||
__portrait_mask__: str = field(default_factory=default_factory_none)
|
||||
|
||||
__landscape_width__: int = field(default_factory=int)
|
||||
__landscape_height__: int = field(default_factory=int)
|
||||
__landscape_x__: int = field(default_factory=int)
|
||||
__landscape_y__: int = field(default_factory=int)
|
||||
__landscape_mask__: str = field(default_factory=default_factory_none)
|
||||
def __str__(self):
|
||||
return '<MockupEngineer.templates.Device {} {} {}>'.format(self.manufacturer, self.name, self.year)
|
||||
|
||||
def __post_init__(self):
|
||||
getattr(self, '__device_init__')()
|
||||
|
||||
self.example_path = '{}/{}/example.png'.format(templates_path, self.__template_path__)
|
||||
|
||||
self.colors = [
|
||||
TemplateColor(
|
||||
color=color,
|
||||
portrait_path='{}/{}/{}/portrait.png'.format(templates_path, self.__template_path__, color_path),
|
||||
landscape_path='{}/{}/{}/landscape.png'.format(templates_path, self.__template_path__, color_path),
|
||||
) for color, color_path in self.__colors__.items()]
|
||||
|
||||
if self.__use_mask__:
|
||||
self.__portrait_mask__ = '{}/{}/portrait-mask.png'.format(templates_path, self.__template_path__)
|
||||
self.__landscape_mask__ = '{}/{}/landscape-mask.png'.format(templates_path, self.__template_path__)
|
||||
self.colors = sorted(self.colors, key=lambda a: a.color)
|
||||
|
|
Before Width: | Height: | Size: 98 KiB |
BIN
MockupEngineer/templates/console_example.png
Normal file
After Width: | Height: | Size: 119 KiB |
Before Width: | Height: | Size: 224 KiB |
|
@ -1,29 +0,0 @@
|
|||
from dataclasses import dataclass
|
||||
|
||||
from MockupEngineer.templates import Template
|
||||
|
||||
|
||||
@dataclass
|
||||
class Device(Template):
|
||||
def __device_init__(self):
|
||||
self.manufacturer = 'Samsung'
|
||||
self.name = 'Galaxy S20'
|
||||
self.type = 'phone'
|
||||
self.year = 2020
|
||||
self.resolution = '{width} x {height}'.format(width=1440, height=3200)
|
||||
|
||||
self.__template_path__ = 'galaxys20'
|
||||
self.__colors__ = {"Cloud Blue": 'blue',
|
||||
"Cosmic Grey": 'grey',
|
||||
"Pink": 'pink'}
|
||||
self.__use_mask__ = True
|
||||
|
||||
self.__portrait_width__ = 1440
|
||||
self.__portrait_height__ = 3200
|
||||
self.__portrait_x__ = 200
|
||||
self.__portrait_y__ = 200
|
||||
|
||||
self.__landscape_width__ = 3200
|
||||
self.__landscape_height__ = 1440
|
||||
self.__landscape_x__ = 200
|
||||
self.__landscape_y__ = 200
|
Before Width: | Height: | Size: 255 KiB After Width: | Height: | Size: 255 KiB |
Before Width: | Height: | Size: 271 KiB |
22
MockupEngineer/templates/galaxys20/config.ini
Normal file
|
@ -0,0 +1,22 @@
|
|||
# https://github.com/ulbwazhine/MockupEngineer
|
||||
|
||||
[info]
|
||||
manufacturer = Samsung
|
||||
name = Galaxy S20
|
||||
type = phone
|
||||
year = 2020
|
||||
width = 1440
|
||||
height = 3200
|
||||
|
||||
[colors]
|
||||
cloud blue = blue.png
|
||||
cosmic grey = grey.png
|
||||
pink = pink.png
|
||||
|
||||
[image]
|
||||
width = 1440
|
||||
height = 3200
|
||||
x = 200
|
||||
y = 200
|
||||
mask = true
|
||||
rotate = true
|
Before Width: | Height: | Size: 350 KiB |
Before Width: | Height: | Size: 250 KiB After Width: | Height: | Size: 250 KiB |
Before Width: | Height: | Size: 266 KiB |
Before Width: | Height: | Size: 100 KiB |
Before Width: | Height: | Size: 107 KiB After Width: | Height: | Size: 107 KiB |
Before Width: | Height: | Size: 255 KiB After Width: | Height: | Size: 255 KiB |
Before Width: | Height: | Size: 271 KiB |
BIN
MockupEngineer/templates/galaxys20/preview.png
Normal file
After Width: | Height: | Size: 4.1 MiB |
|
@ -1,28 +0,0 @@
|
|||
from dataclasses import dataclass
|
||||
|
||||
from MockupEngineer.templates import Template
|
||||
|
||||
|
||||
@dataclass
|
||||
class Device(Template):
|
||||
def __device_init__(self):
|
||||
self.manufacturer = 'Samsung'
|
||||
self.name = 'Galaxy S20 Ultra'
|
||||
self.type = 'phone'
|
||||
self.year = 2020
|
||||
self.resolution = '{width} x {height}'.format(width=1440, height=3200)
|
||||
|
||||
self.__template_path__ = 'galaxys20'
|
||||
self.__colors__ = {"Cosmic Black": 'black',
|
||||
"Cosmic Grey": 'grey'}
|
||||
self.__use_mask__ = True
|
||||
|
||||
self.__portrait_width__ = 1440
|
||||
self.__portrait_height__ = 3200
|
||||
self.__portrait_x__ = 200
|
||||
self.__portrait_y__ = 200
|
||||
|
||||
self.__landscape_width__ = 3200
|
||||
self.__landscape_height__ = 1440
|
||||
self.__landscape_x__ = 200
|
||||
self.__landscape_y__ = 200
|
Before Width: | Height: | Size: 234 KiB After Width: | Height: | Size: 234 KiB |
Before Width: | Height: | Size: 242 KiB |
21
MockupEngineer/templates/galaxys20ultra/config.ini
Normal file
|
@ -0,0 +1,21 @@
|
|||
# https://github.com/ulbwazhine/MockupEngineer
|
||||
|
||||
[info]
|
||||
manufacturer = Samsung
|
||||
name = Galaxy S20 Ultra
|
||||
type = phone
|
||||
year = 2020
|
||||
width = 1440
|
||||
height = 3200
|
||||
|
||||
[colors]
|
||||
cosmic black = black.png
|
||||
cosmic grey = grey.png
|
||||
|
||||
[image]
|
||||
width = 1440
|
||||
height = 3200
|
||||
x = 200
|
||||
y = 200
|
||||
mask = true
|
||||
rotate = true
|
Before Width: | Height: | Size: 195 KiB |
Before Width: | Height: | Size: 242 KiB After Width: | Height: | Size: 242 KiB |
Before Width: | Height: | Size: 256 KiB |
Before Width: | Height: | Size: 100 KiB |
Before Width: | Height: | Size: 105 KiB After Width: | Height: | Size: 105 KiB |
BIN
MockupEngineer/templates/galaxys20ultra/preview.png
Normal file
After Width: | Height: | Size: 4.1 MiB |
|
@ -1,26 +0,0 @@
|
|||
from dataclasses import dataclass
|
||||
|
||||
from MockupEngineer.templates import Template
|
||||
|
||||
|
||||
@dataclass
|
||||
class Device(Template):
|
||||
def __device_init__(self):
|
||||
self.manufacturer = 'Apple'
|
||||
self.name = 'iMac 21"'
|
||||
self.type = 'pc'
|
||||
self.year = 2015
|
||||
self.resolution = '{width} x {height}'.format(width=4096, height=2304)
|
||||
|
||||
self.__template_path__ = 'imac212015'
|
||||
self.__colors__ = {"Silver": 'silver'}
|
||||
|
||||
self.__portrait_width__ = 1693
|
||||
self.__portrait_height__ = 954
|
||||
self.__portrait_x__ = 173
|
||||
self.__portrait_y__ = 178
|
||||
|
||||
self.__landscape_width__ = 1693
|
||||
self.__landscape_height__ = 954
|
||||
self.__landscape_x__ = 173
|
||||
self.__landscape_y__ = 178
|
20
MockupEngineer/templates/imac212015/config.ini
Normal file
|
@ -0,0 +1,20 @@
|
|||
# https://github.com/ulbwazhine/MockupEngineer
|
||||
|
||||
[info]
|
||||
manufacturer = Apple
|
||||
name = iMac 21"
|
||||
type = pc
|
||||
year = 2015
|
||||
width = 4096
|
||||
height = 2304
|
||||
|
||||
[colors]
|
||||
silver = silver.png
|
||||
|
||||
[image]
|
||||
width = 1693
|
||||
height = 954
|
||||
x = 173
|
||||
y = 178
|
||||
mask = false
|
||||
rotate = false
|
Before Width: | Height: | Size: 560 KiB |
BIN
MockupEngineer/templates/imac212015/preview.png
Normal file
After Width: | Height: | Size: 1.6 MiB |
Before Width: | Height: | Size: 508 KiB After Width: | Height: | Size: 508 KiB |
Before Width: | Height: | Size: 508 KiB |
|
@ -1,32 +0,0 @@
|
|||
from dataclasses import dataclass
|
||||
|
||||
from MockupEngineer.templates import Template
|
||||
|
||||
|
||||
@dataclass
|
||||
class Device(Template):
|
||||
def __device_init__(self):
|
||||
self.manufacturer = 'Apple'
|
||||
self.name = 'iMac 24"'
|
||||
self.type = 'pc'
|
||||
self.year = 2021
|
||||
self.resolution = '{width} x {height}'.format(width=4480, height=2520)
|
||||
|
||||
self.__template_path__ = 'imac242021'
|
||||
self.__colors__ = {"Blue": 'blue',
|
||||
"Green": 'green',
|
||||
"Orange": 'orange',
|
||||
"Pink": 'pink',
|
||||
"Purple": 'purple',
|
||||
"Silver": 'silver',
|
||||
"Yellow": 'yellow'}
|
||||
|
||||
self.__portrait_width__ = 2008
|
||||
self.__portrait_height__ = 1131
|
||||
self.__portrait_x__ = 246
|
||||
self.__portrait_y__ = 144
|
||||
|
||||
self.__landscape_width__ = 2008
|
||||
self.__landscape_height__ = 1131
|
||||
self.__landscape_x__ = 246
|
||||
self.__landscape_y__ = 144
|
Before Width: | Height: | Size: 1.7 MiB |
Before Width: | Height: | Size: 1.7 MiB |
Before Width: | Height: | Size: 1.7 MiB |
Before Width: | Height: | Size: 1.3 MiB |
Before Width: | Height: | Size: 1.3 MiB |
Before Width: | Height: | Size: 1.6 MiB |
Before Width: | Height: | Size: 1.6 MiB |
Before Width: | Height: | Size: 1.7 MiB |
Before Width: | Height: | Size: 1.7 MiB |
Before Width: | Height: | Size: 1.6 MiB |
Before Width: | Height: | Size: 1.6 MiB |
Before Width: | Height: | Size: 1.9 MiB |
Before Width: | Height: | Size: 1.9 MiB |
Before Width: | Height: | Size: 1.7 MiB |
Before Width: | Height: | Size: 1.7 MiB |
|
@ -1,28 +0,0 @@
|
|||
from dataclasses import dataclass
|
||||
|
||||
from MockupEngineer.templates import Template
|
||||
|
||||
|
||||
@dataclass
|
||||
class Device(Template):
|
||||
def __device_init__(self):
|
||||
self.manufacturer = 'Apple'
|
||||
self.name = 'iPad 9'
|
||||
self.type = 'tablet'
|
||||
self.year = 2021
|
||||
self.resolution = '{width} x {height}'.format(width=2160, height=1620)
|
||||
|
||||
self.__template_path__ = 'ipad9'
|
||||
self.__colors__ = {"Gold": 'gold',
|
||||
"Silver": 'silver',
|
||||
"Space Gray": 'spacegray'}
|
||||
|
||||
self.__portrait_width__ = 1620
|
||||
self.__portrait_height__ = 2160
|
||||
self.__portrait_x__ = 150
|
||||
self.__portrait_y__ = 275
|
||||
|
||||
self.__landscape_width__ = 2160
|
||||
self.__landscape_height__ = 1620
|
||||
self.__landscape_x__ = 275
|
||||
self.__landscape_y__ = 150
|
22
MockupEngineer/templates/ipad9/config.ini
Normal file
|
@ -0,0 +1,22 @@
|
|||
# https://github.com/ulbwazhine/MockupEngineer
|
||||
|
||||
[info]
|
||||
manufacturer = Apple
|
||||
name = iPad 9
|
||||
type = tablet
|
||||
year = 2021
|
||||
width = 2160
|
||||
height = 1620
|
||||
|
||||
[colors]
|
||||
gold = gold.png
|
||||
silver = silver.png
|
||||
space gray = spacegray.png
|
||||
|
||||
[image]
|
||||
width = 1620
|
||||
height = 2160
|
||||
x = 150
|
||||
y = 275
|
||||
mask = false
|
||||
rotate = true
|
Before Width: | Height: | Size: 387 KiB |
Before Width: | Height: | Size: 214 KiB After Width: | Height: | Size: 214 KiB |
Before Width: | Height: | Size: 230 KiB |
BIN
MockupEngineer/templates/ipad9/preview.png
Normal file
After Width: | Height: | Size: 2.7 MiB |
Before Width: | Height: | Size: 246 KiB After Width: | Height: | Size: 246 KiB |
Before Width: | Height: | Size: 238 KiB |
Before Width: | Height: | Size: 285 KiB After Width: | Height: | Size: 285 KiB |
Before Width: | Height: | Size: 272 KiB |
|
@ -1,30 +0,0 @@
|
|||
from dataclasses import dataclass
|
||||
|
||||
from MockupEngineer.templates import Template
|
||||
|
||||
|
||||
@dataclass
|
||||
class Device(Template):
|
||||
def __device_init__(self):
|
||||
self.manufacturer = 'Apple'
|
||||
self.name = 'iPad Air 4'
|
||||
self.type = 'tablet'
|
||||
self.year = 2020
|
||||
self.resolution = '{width} x {height}'.format(width=2360, height=1640)
|
||||
|
||||
self.__template_path__ = 'ipadair4'
|
||||
self.__colors__ = {"Green": 'green',
|
||||
"Rose Gold": 'rosegold',
|
||||
"Silver": 'silver',
|
||||
"Sky Blue": 'skyblue',
|
||||
"Space Gray": 'spacegray'}
|
||||
|
||||
self.__portrait_width__ = 1640
|
||||
self.__portrait_height__ = 2360
|
||||
self.__portrait_x__ = 150
|
||||
self.__portrait_y__ = 150
|
||||
|
||||
self.__landscape_width__ = 2360
|
||||
self.__landscape_height__ = 1640
|
||||
self.__landscape_x__ = 150
|
||||
self.__landscape_y__ = 150
|
24
MockupEngineer/templates/ipadair4/config.ini
Normal file
|
@ -0,0 +1,24 @@
|
|||
# https://github.com/ulbwazhine/MockupEngineer
|
||||
|
||||
[info]
|
||||
manufacturer = Apple
|
||||
name = iPad Air 4
|
||||
type = tablet
|
||||
year = 2020
|
||||
width = 2360
|
||||
height = 1640
|
||||
|
||||
[colors]
|
||||
green = green.png
|
||||
rose gold = rosegold.png
|
||||
silver = silver.png
|
||||
sky blue = skyblue.png
|
||||
space gray = spacegray.png
|
||||
|
||||
[image]
|
||||
width = 1640
|
||||
height = 2360
|
||||
x = 150
|
||||
y = 150
|
||||
mask = false
|
||||
rotate = true
|
Before Width: | Height: | Size: 380 KiB |
Before Width: | Height: | Size: 256 KiB After Width: | Height: | Size: 256 KiB |
Before Width: | Height: | Size: 228 KiB |
BIN
MockupEngineer/templates/ipadair4/preview.png
Normal file
After Width: | Height: | Size: 3.0 MiB |
Before Width: | Height: | Size: 264 KiB After Width: | Height: | Size: 264 KiB |
Before Width: | Height: | Size: 233 KiB |
Before Width: | Height: | Size: 254 KiB After Width: | Height: | Size: 254 KiB |
Before Width: | Height: | Size: 227 KiB |
Before Width: | Height: | Size: 264 KiB After Width: | Height: | Size: 264 KiB |
Before Width: | Height: | Size: 233 KiB |
Before Width: | Height: | Size: 252 KiB After Width: | Height: | Size: 252 KiB |
Before Width: | Height: | Size: 225 KiB |
|
@ -1,28 +0,0 @@
|
|||
from dataclasses import dataclass
|
||||
|
||||
from MockupEngineer.templates import Template
|
||||
|
||||
|
||||
@dataclass
|
||||
class Device(Template):
|
||||
def __device_init__(self):
|
||||
self.manufacturer = 'Apple'
|
||||
self.name = 'iPad Mini 5'
|
||||
self.type = 'tablet'
|
||||
self.year = 2021
|
||||
self.resolution = '{width} x {height}'.format(width=2048, height=1536)
|
||||
|
||||
self.__template_path__ = 'ipadmini5'
|
||||
self.__colors__ = {"Gold": 'gold',
|
||||
"Silver": 'silver',
|
||||
"Space Gray": 'spacegray'}
|
||||
|
||||
self.__portrait_width__ = 1536
|
||||
self.__portrait_height__ = 2048
|
||||
self.__portrait_x__ = 150
|
||||
self.__portrait_y__ = 330
|
||||
|
||||
self.__landscape_width__ = 2048
|
||||
self.__landscape_height__ = 1536
|
||||
self.__landscape_x__ = 330
|
||||
self.__landscape_y__ = 150
|
22
MockupEngineer/templates/ipadmini5/config.ini
Normal file
|
@ -0,0 +1,22 @@
|
|||
# https://github.com/ulbwazhine/MockupEngineer
|
||||
|
||||
[info]
|
||||
manufacturer = Apple
|
||||
name = iPad Mini 5
|
||||
type = tablet
|
||||
year = 2021
|
||||
width = 2048
|
||||
height = 1536
|
||||
|
||||
[colors]
|
||||
gold = gold.png
|
||||
silver = silver.png
|
||||
space gray = spacegray.png
|
||||
|
||||
[image]
|
||||
width = 1536
|
||||
height = 2048
|
||||
x = 150
|
||||
y = 330
|
||||
mask = false
|
||||
rotate = true
|
Before Width: | Height: | Size: 397 KiB |
Before Width: | Height: | Size: 222 KiB After Width: | Height: | Size: 222 KiB |
Before Width: | Height: | Size: 235 KiB |
BIN
MockupEngineer/templates/ipadmini5/preview.png
Normal file
After Width: | Height: | Size: 2.6 MiB |
Before Width: | Height: | Size: 215 KiB After Width: | Height: | Size: 215 KiB |
Before Width: | Height: | Size: 225 KiB |
Before Width: | Height: | Size: 300 KiB After Width: | Height: | Size: 300 KiB |
Before Width: | Height: | Size: 279 KiB |
|
@ -1,27 +0,0 @@
|
|||
from dataclasses import dataclass
|
||||
|
||||
from MockupEngineer.templates import Template
|
||||
|
||||
|
||||
@dataclass
|
||||
class Device(Template):
|
||||
def __device_init__(self):
|
||||
self.manufacturer = 'Apple'
|
||||
self.name = 'iPad Pro 4 11"'
|
||||
self.type = 'tablet'
|
||||
self.year = 2020
|
||||
self.resolution = '{width} x {height}'.format(width=2388, height=1668)
|
||||
|
||||
self.__template_path__ = 'ipadpro114'
|
||||
self.__colors__ = {"Silver": 'silver',
|
||||
"Space Gray": 'spacegray'}
|
||||
|
||||
self.__portrait_width__ = 1668
|
||||
self.__portrait_height__ = 2388
|
||||
self.__portrait_x__ = 200
|
||||
self.__portrait_y__ = 200
|
||||
|
||||
self.__landscape_width__ = 2388
|
||||
self.__landscape_height__ = 1668
|
||||
self.__landscape_x__ = 200
|
||||
self.__landscape_y__ = 200
|
21
MockupEngineer/templates/ipadpro114/config.ini
Normal file
|
@ -0,0 +1,21 @@
|
|||
# https://github.com/ulbwazhine/MockupEngineer
|
||||
|
||||
[info]
|
||||
manufacturer = Apple
|
||||
name = iPad Pro 4 11"
|
||||
type = tablet
|
||||
year = 2020
|
||||
width = 2388
|
||||
height = 1668
|
||||
|
||||
[colors]
|
||||
silver = silver.png
|
||||
space gray = spacegray.png
|
||||
|
||||
[image]
|
||||
width = 1668
|
||||
height = 2388
|
||||
x = 200
|
||||
y = 200
|
||||
mask = false
|
||||
rotate = true
|
Before Width: | Height: | Size: 362 KiB |
BIN
MockupEngineer/templates/ipadpro114/preview.png
Normal file
After Width: | Height: | Size: 3.4 MiB |
Before Width: | Height: | Size: 250 KiB After Width: | Height: | Size: 250 KiB |
Before Width: | Height: | Size: 223 KiB |
Before Width: | Height: | Size: 245 KiB After Width: | Height: | Size: 245 KiB |
Before Width: | Height: | Size: 217 KiB |
|
@ -1,27 +0,0 @@
|
|||
from dataclasses import dataclass
|
||||
|
||||
from MockupEngineer.templates import Template
|
||||
|
||||
|
||||
@dataclass
|
||||
class Device(Template):
|
||||
def __device_init__(self):
|
||||
self.manufacturer = 'Apple'
|
||||
self.name = 'iPad Pro 4 12.9"'
|
||||
self.type = 'tablet'
|
||||
self.year = 2020
|
||||
self.resolution = '{width} x {height}'.format(width=2732, height=2048)
|
||||
|
||||
self.__template_path__ = 'ipadpro134'
|
||||
self.__colors__ = {"Silver": 'silver',
|
||||
"Space Gray": 'spacegray'}
|
||||
|
||||
self.__portrait_width__ = 2048
|
||||
self.__portrait_height__ = 2732
|
||||
self.__portrait_x__ = 200
|
||||
self.__portrait_y__ = 200
|
||||
|
||||
self.__landscape_width__ = 2732
|
||||
self.__landscape_height__ = 2048
|
||||
self.__landscape_x__ = 200
|
||||
self.__landscape_y__ = 200
|
21
MockupEngineer/templates/ipadpro134/config.ini
Normal file
|
@ -0,0 +1,21 @@
|
|||
# https://github.com/ulbwazhine/MockupEngineer
|
||||
|
||||
[info]
|
||||
manufacturer = Apple
|
||||
name = iPad Pro 4 12.9"
|
||||
type = tablet
|
||||
year = 2020
|
||||
width = 2732
|
||||
height = 2048
|
||||
|
||||
[colors]
|
||||
silver = silver.png
|
||||
space gray = spacegray.png
|
||||
|
||||
[image]
|
||||
width = 2048
|
||||
height = 2732
|
||||
x = 200
|
||||
y = 200
|
||||
mask = false
|
||||
rotate = true
|
Before Width: | Height: | Size: 396 KiB |
BIN
MockupEngineer/templates/ipadpro134/preview.png
Normal file
After Width: | Height: | Size: 4.6 MiB |
Before Width: | Height: | Size: 299 KiB After Width: | Height: | Size: 299 KiB |
Before Width: | Height: | Size: 275 KiB |
Before Width: | Height: | Size: 292 KiB After Width: | Height: | Size: 292 KiB |