猫史档案馆


找师傅!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

用户:挖坟专家挖坟专家查看:10 回复:7 评论:10 创建时间:2020-08-01T12:02:34


我会Qt、arcade、PIL、好像没有了。

看看有没有人要我这个垃圾

(不要kitten的)

from arcade import *
import math
# import MessageListener
w = 800
h = 600
t = 'sss'
class X(arcade.Window):
    def __init__(self, w, h, te):
        super().__init__(w,h,te)
        self.setup()
    def setup(self):
        self.t_t = True
        self.ott = 1
        self.a = h-445
        self.ab =h-455
        self.b = h-435
        self.bb = h-445
        self.an,self.bn = w//2, h-150
        self.angle = 0
        self.an = w//2 + 200 * math.sin(math.radians(self.angle))
        self.bn = (h//2+100-200) + 200 * math.cos(math.radians(self.angle))
        if self.ott < 4:
            set_background_color(color.GRAY)
        else:
            set_background_color(color.RED)
        schedule(self.c, 0.3)
    def on_draw(self):
        start_render()
        if self.ott <= 3:
            draw_rectangle_filled(w//2, h-150, 50, 100, color.WHITE)
            draw_circle_outline(w//2, h-150, 10, color.COBALT, 5)
            draw_triangle_filled(w//2-25,h-100,w//2+25,h-100,w//2,h-50,color.RED)
        if self.ott <= 2:
            draw_rectangle_filled(w//2, h-250, 30, 100, color.WHITE)
        if self.ott <= 1:
            draw_rectangle_filled(w//2, h-350, 50, 100, color.WHITE)
            draw_rectangle_filled(w//2 - 50, h-350, 30, 100, color.COBALT)
            draw_rectangle_filled(w//2 + 50, h-350, 30, 100, color.COBALT)
        
        if self.t_t and self.ott <=3:
            draw_rectangle_filled(w//2 + 50, self.a, 30, 80, color.ORANGE)
            draw_rectangle_filled(w//2 - 50, self.a, 30, 80, color.ORANGE)
            draw_rectangle_filled(w//2, self.ab, 50, 100, color.ORANGE)
        elif not self.t_t and self.ott <=3:
            draw_rectangle_filled(w//2 - 50, self.b, 30, 60, color.ORANGE)
            draw_rectangle_filled(w//2 + 50, self.b, 30, 60, color.ORANGE)
            draw_rectangle_filled(w//2, self.bb, 50, 80, color.ORANGE)
        if self.ott >=4:
            an = w//2 + 200 * math.sin(math.radians(self.angle))
            bn = (h//2+100-200) + 200 * math.cos(math.radians(self.angle))
            draw_rectangle_filled(an, bn, 50, 100, color.WHITE, self.angle)
            draw_rectangle_filled(an, bn, 150, 50, color.BLUE, self.angle)
            draw_circle_filled(w//2, h//2-100, 100, color.BLUE)
        # draw_rectangle_filled()
    def c(self,time):
        self.t_t = not self.t_t
    def on_update(self, delta_time):
        self.angle += 1
    def on_mouse_release(self,x,y,button,modifiers):
        self.ott += 1
        self.a += 100
        self.ab += 100
        self.b +=100
        self.bb +=100
# MessageListener.main()
if __name__ == '__main__':
    game = X(w,h,t)
    run()

import matplotlib.pyplot as plt
from PIL import Image, ImageFilter
img = Image.open('bcm.jpg')
#ImageFilter.GaussianBlur(数字), ImageFilter.BLUR, ImageFilter.Contour, ImageFilter.Emboss, ImageFilter.Sharpen, ImageFilter.Smooth

e = [ImageFilter.BLUR, ImageFilter.CONTOUR, ImageFilter.EMBOSS, ImageFilter.SHARPEN, ImageFilter.SNOOTH, mageFilter.EDGE_ENHANGE]

for i in range(len(e)):
    im = img.filter(e[i])
    plt.imshow(im)
    plt.show()
    im.save('bcm_{}.jpg'.format(i))

(如果代码出现了喵请说出来)


回复

上一页1 页 / 共 1下一页
挖坟专家挖坟专家

<DD>https://shequ.codemao.cn/community/328718</DD>

点赞0


评论


挖坟专家挖坟专家

from PySide2 import QtCore, QtGui, QtWidgets

class Ui_process_img(object):
    def setupUi(self, process_img):
        process_img.setObjectName("process_img")
        process_img.resize(795, 352)
        self.centralwidget = QtWidgets.QWidget(process_img)
        self.centralwidget.setObjectName("centralwidget")
        self.verticalLayout = QtWidgets.QVBoxLayout(self.centralwidget)
        self.verticalLayout.setObjectName("verticalLayout")
        self.splitter = QtWidgets.QSplitter(self.centralwidget)
        self.splitter.setOrientation(QtCore.Qt.Horizontal)
        self.splitter.setObjectName("splitter")
        self.pbtn_file = QtWidgets.QPushButton(self.splitter)
        font = QtGui.QFont()
        font.setPointSize(20)
        self.pbtn_file.setFont(font)
        self.pbtn_file.setObjectName("pbtn_file")
        self.cb_filter_list = QtWidgets.QComboBox(self.splitter)
        self.cb_filter_list.setMinimumSize(QtCore.QSize(300, 0))
        self.cb_filter_list.setMaximumSize(QtCore.QSize(16777215, 50))
        font = QtGui.QFont()
        font.setPointSize(20)
        self.cb_filter_list.setFont(font)
        self.cb_filter_list.setObjectName("cb_filte_list")
        self.cb_filter_list.a喵Item("")
        self.cb_filter_list.a喵Item("")
        self.cb_filter_list.a喵Item("")
        self.cb_filter_list.a喵Item("")
        self.cb_filter_list.a喵Item("")
        self.cb_filter_list.a喵Item("")
        self.cb_filter_list.a喵Item("")
        self.pbtn_process = QtWidgets.QPushButton(self.splitter)
        font = QtGui.QFont()
        font.setPointSize(20)
        self.pbtn_process.setFont(font)
        self.pbtn_process.setObjectName("pbtn_process")
        self.verticalLayout.a喵Widget(self.splitter)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.lb_input_img = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setPointSize(30)
        self.lb_input_img.setFont(font)
        self.lb_input_img.setAlignment(QtCore.Qt.AlignCenter)
        self.lb_input_img.setObjectName("lb_input_img")
        self.horizontalLayout.a喵Widget(self.lb_input_img)
        self.lb_output_img = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setPointSize(30)
        self.lb_output_img.setFont(font)
        self.lb_output_img.setAlignment(QtCore.Qt.AlignCenter)
        self.lb_output_img.setObjectName("lb_output_img")
        self.horizontalLayout.a喵Widget(self.lb_output_img)
        self.verticalLayout.a喵Layout(self.horizontalLayout)
        process_img.setCentralWidget(self.centralwidget)
        self.statusbar = QtWidgets.QStatusBar(process_img)
        self.statusbar.setObjectName("statusbar")
        process_img.setStatusBar(self.statusbar)

        self.retranslateUi(process_img)
        QtCore.QMetaObject.connectSlotsByName(process_img)

    def retranslateUi(self, process_img):
        process_img.setWindowTitle(QtWidgets.QApplication.translate("process_img", "滤镜处理", None, -1))
        self.pbtn_file.setText(QtWidgets.QApplication.translate("process_img", "选择图片文件", None, -1))
        self.cb_filter_list.setItemText(0, QtWidgets.QApplication.translate("process_img", "模糊滤镜", None, -1))
        self.cb_filter_list.setItemText(1, QtWidgets.QApplication.translate("process_img", "细节增强滤镜", None, -1))
        self.cb_filter_list.setItemText(2, QtWidgets.QApplication.translate("process_img", "轮廓滤镜", None, -1))
        self.cb_filter_list.setItemText(3, QtWidgets.QApplication.translate("process_img", "边缘强化滤镜", None, -1))
        self.cb_filter_list.setItemText(4, QtWidgets.QApplication.translate("process_img", "浮雕滤镜", None, -1))
        self.cb_filter_list.setItemText(5, QtWidgets.QApplication.translate("process_img", "锐化滤镜", None, -1))
        self.cb_filter_list.setItemText(6, QtWidgets.QApplication.translate("process_img", "平滑滤镜", None, -1))
        self.pbtn_process.setText(QtWidgets.QApplication.translate("process_img", "开始处理", None, -1))
        self.lb_input_img.setText(QtWidgets.QApplication.translate("process_img", "处理前", None, -1))
        self.lb_output_img.setText(QtWidgets.QApplication.translate("process_img", "处理后", None, -1))

Qt的代码

点赞1


评论


挖坟专家挖坟专家

dd

点赞0


评论


挖坟专家挖坟专家

dd

点赞0


评论


挖坟专家挖坟专家

dd

点赞0


评论


OrieoOrieo

彩色emotion_喵喵emotion_喵喵 emotion_喵喵emotion_喵喵

点赞0


评论


玖沫_玖沫_

我行吗

点赞0


评论