Skip to content

Commit

Permalink
transparent background added
Browse files Browse the repository at this point in the history
  • Loading branch information
miguel-martinr committed Jan 11, 2022
1 parent 2aecb17 commit 5a13d58
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/pycture/editor/image/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from math import ceil, log2, sqrt, floor, trunc, sin, cos, pi
from typing import List
from PyQt5 import QtCore
from PyQt5 import QtGui
import numpy as np

from PyQt5.QtGui import QColor, QImage, QPixmap
Expand Down Expand Up @@ -330,6 +332,7 @@ def rotation_matrix(angle_rad: float):
new_height = ceil(abs(max_y - min_y))

new_image = QImage(new_width, new_height, self.format())
new_image.fill(QtGui.QColorConstants.Transparent)

for X in range(self.width()):
for Y in range(self.height()):
Expand Down

0 comments on commit 5a13d58

Please sign in to comment.