国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

【Python】關(guān)于圖片操作(續(xù))

2023-03-30 23:06 作者:RhinoCode  | 我要投稿

與上篇內(nèi)容區(qū)別:將導(dǎo)入圖片的分別率大小改變再進(jìn)行操作。

__author__ = "RhinoCode BiliBili"

__version__ = "2023.03.30"

import System.Drawing as sd

import Rhino.Geometry as rg


#導(dǎo)入圖片

image_path = "D:\LG\Record\C_封面\gg.jpg"

image = sd.Bitmap(image_path)


#獲取圖片分辨率

width, height = image.Width, image.Height


#改變圖片分別率

re_width, re_height = int(width/10), int(height/10)

resize_image = sd.Bitmap(re_width,re_height)

graphics = sd.Graphics.FromImage(resize_image)

graphics.DrawImage(image,0,0,re_width,re_height)

graphics.Dispose()


#在圖片范圍內(nèi)生成點(diǎn),點(diǎn)的z值為點(diǎn)對應(yīng)圖片位置顏色RGB的B通道值

colors = []

points = []

for x in range(re_width):

? ? for y in range(re_height):

? ? ? ? color = resize_image.GetPixel(x,y)

? ? ? ? colors.append(color)

? ? ? ? point = rg.Point3d(x,y,color.B/100)

? ? ? ? points.append(point)


#輸出

a = colors

b = points


【Python】關(guān)于圖片操作(續(xù))的評論 (共 條)

分享到微博請遵守國家法律
孝义市| 宝山区| 兴和县| 太和县| 昆明市| 米易县| 教育| 江永县| 环江| 仁布县| 宝鸡市| 平乐县| 辰溪县| 京山县| 宣城市| 九台市| 邮箱| 泾阳县| 北流市| 从化市| 赤壁市| 庆云县| 柳河县| 湟源县| 黄梅县| 龙陵县| 迁安市| 习水县| 唐河县| 丰顺县| 海南省| 绍兴县| 娄底市| 昔阳县| 芦山县| 阜阳市| 东兰县| 隆昌县| 南和县| 通许县| 铜川市|