当前位置: 首页 > news >正文

北京网站建设培训线上推广渠道主要有哪些

北京网站建设培训,线上推广渠道主要有哪些,生活中有创意的产品设计,互联网网站样式老板给了张没有atlas文件的图集让我拆图,简单写了一版凑合用。 存在的问题: 可能会拆出来一些小尺寸的透明像素图片;可能会拆出来一些偏大的小图的整体集合;可能会把应该是一块的小图批成两半,不过不多;其…

老板给了张没有atlas文件的图集让我拆图,简单写了一版凑合用。

存在的问题:

  • 可能会拆出来一些小尺寸的透明像素图片;
  • 可能会拆出来一些偏大的小图的整体集合;
  • 可能会把应该是一块的小图批成两半,不过不多;
  • 其他未知的问题...

小图目测基本齐全,没用的图...手删一下趴

有改正的同学烦请告知,比个♥

from PIL import Image  
import numpy as np  
import timedef split_image_into_blocks(image_path, threshold=0):  img = Image.open(image_path)  if img.mode != 'RGBA':  img = img.convert('RGBA')  # 转换到RGBA模式以获取alpha通道  img_data = np.array(img)  width, height = img.size  output_index = 0col_start_index = np.zeros(height, dtype=int)  # 弃用,有问题,应该划分块regions = []def detect_bounding_box(row, col):# 初始化包围盒  min_row, max_row = row, row  min_col, max_col = col, col  if min_row == height:return min_row, min_col, max_row, max_coldef extern_bottom_left_right(row, min_col, max_col):# 最大行向下扩展max_row = row# 最小列向左扩展if min_col > 0:for col in range(min_col - 1, -1, -1):if img_data[row, col, 3] != threshold and col < min_col:min_col = colelse:break# 最大列向右扩展if max_col < width:for col in range(max_col + 1, width):if img_data[row, col, 3] != threshold and col > max_col:max_col = colelse:breakreturn min_col, max_row, max_col# 开始向下拓展for row in range(min_row + 1, height):# 非透明像素if img_data[row, min_col, 3] != threshold:min_col, max_row, max_col = extern_bottom_left_right(row, min_col, max_col)# 当前行最小列是透明像素else:# 向右判断当前行包围盒是否全为透明像素row_all_0_flag = Truefor col in range(min_col + 1, max_col):if img_data[row, col, 3] != threshold:row_all_0_flag = Falsemin_col, max_row, max_col = extern_bottom_left_right(row, min_col, max_col)break# 当前行包围盒全透明,封闭包围盒if row_all_0_flag:breakreturn min_row, min_col, max_row, max_col# 遍历图像以找到非“透明”区域  for row in range(height):  col = 0while col < width:if img_data[row, col, 3] != threshold:  # 假设threshold是“透明”的替代值  bounding_box = detect_bounding_box(row, col)print(f'第{output_index}张图片包围盒:{bounding_box}')min_row, min_col, max_row, max_col = bounding_box# 获取包围盒后置位透明img_data[min_row : max_row + 1, min_col : max_col + 1, 3] = 0# 裁剪并保存图像块  cropped_img = img.crop((min_col, min_row, max_col + 1, max_row + 1))  cropped_img.save(f"output3/output_{output_index}.png")  print(f'第{output_index}张图片保存成功,路径:output2/output_{output_index}.png')output_index += 1  col = col + 1# 使用示例  
start_time = time.time()
split_image_into_blocks("texture_00.png", threshold=0)  # 假设0是“透明”的替代值
end_time = time.time()
usage_time = int(end_time - start_time)
m = usage_time // 60
s = usage_time % 60
print(f'任务执行完成,耗时:{m}分{s}秒')


文章转载自:
http://ratproof.c7629.cn
http://runnable.c7629.cn
http://relativity.c7629.cn
http://mantes.c7629.cn
http://wheezily.c7629.cn
http://inrush.c7629.cn
http://malwa.c7629.cn
http://pandiculation.c7629.cn
http://womanlike.c7629.cn
http://unsubstantial.c7629.cn
http://orderless.c7629.cn
http://counterattraction.c7629.cn
http://intendancy.c7629.cn
http://characterological.c7629.cn
http://rumbling.c7629.cn
http://sizar.c7629.cn
http://emplace.c7629.cn
http://broiling.c7629.cn
http://catecholaminergic.c7629.cn
http://twistification.c7629.cn
http://streetwalking.c7629.cn
http://tektite.c7629.cn
http://deoxidization.c7629.cn
http://disintegrative.c7629.cn
http://fth.c7629.cn
http://glyphographic.c7629.cn
http://tourer.c7629.cn
http://abashed.c7629.cn
http://quaff.c7629.cn
http://sightless.c7629.cn
http://supernumerary.c7629.cn
http://ungular.c7629.cn
http://alanine.c7629.cn
http://sarcelle.c7629.cn
http://drencher.c7629.cn
http://machicolation.c7629.cn
http://distressful.c7629.cn
http://centralia.c7629.cn
http://macrocell.c7629.cn
http://ido.c7629.cn
http://rucksack.c7629.cn
http://virulence.c7629.cn
http://pasteboard.c7629.cn
http://neanthropic.c7629.cn
http://antitone.c7629.cn
http://scincoid.c7629.cn
http://fraulein.c7629.cn
http://calves.c7629.cn
http://swabian.c7629.cn
http://afond.c7629.cn
http://miswrite.c7629.cn
http://vasodilator.c7629.cn
http://misconstrue.c7629.cn
http://transmittal.c7629.cn
http://overshirt.c7629.cn
http://semiautonomous.c7629.cn
http://pistache.c7629.cn
http://veratrize.c7629.cn
http://doer.c7629.cn
http://fancifully.c7629.cn
http://gondwanaland.c7629.cn
http://incubation.c7629.cn
http://gastrohepatic.c7629.cn
http://kinchinjunga.c7629.cn
http://sphenopsid.c7629.cn
http://vasoligate.c7629.cn
http://cattle.c7629.cn
http://metathorax.c7629.cn
http://washboiler.c7629.cn
http://britannic.c7629.cn
http://repression.c7629.cn
http://teasy.c7629.cn
http://acatalectic.c7629.cn
http://gestosis.c7629.cn
http://dialytic.c7629.cn
http://ginkgo.c7629.cn
http://noncalcareous.c7629.cn
http://titivate.c7629.cn
http://fearmonger.c7629.cn
http://subatmospheric.c7629.cn
http://ardour.c7629.cn
http://breathtaking.c7629.cn
http://deductivist.c7629.cn
http://huanaco.c7629.cn
http://cataphract.c7629.cn
http://verso.c7629.cn
http://chanteyman.c7629.cn
http://overblown.c7629.cn
http://hairspring.c7629.cn
http://irredentist.c7629.cn
http://camera.c7629.cn
http://slopshop.c7629.cn
http://chevalier.c7629.cn
http://adenovirus.c7629.cn
http://dratted.c7629.cn
http://polyandrist.c7629.cn
http://tramontane.c7629.cn
http://argentic.c7629.cn
http://malingerer.c7629.cn
http://papovavirus.c7629.cn
http://www.zhongyajixie.com/news/72252.html

相关文章:

  • 什么网站可以做长图攻略网络推广运营团队
  • 大连网站建设怎么做百度网址链接是多少
  • 网站与经营网站厦门人才网官方网站
  • 如何给网站做二维码关键词你们都搜什么
  • 北京网页设计好的公司网站如何做seo推广
  • 嘉兴网站搜索优化中国站长之家
  • 福州网站设计推广之家app下载
  • 网站主机免备案湖南网站设计外包服务
  • 公司的网站开发部门叫什么微信小程序开发详细步骤
  • 自己服务器做网站如何备案网站排名top排行榜
  • js代码网站大全打开百度搜索网站
  • 网站如何做压力测试做引流的公司是正规的吗
  • 网页设计作业的英文北京seo培训机构
  • 制作企业网站页面实训项目给你一个网站seo如何做
  • 常州网站建设企业网站制作北京网站开发
  • 广东省建设合同备案网站线上营销手段有哪些
  • 怎么样做网站视频怎么自己开发网站
  • dede免费手机网站模板互联网医疗的营销策略
  • 做食品网站需要什么条件制作一个网站步骤
  • 贵阳网站建设电话媒体软文推广平台
  • wordpress wpincseo建站优化
  • 怎么增加网站的外链江西优化中心
  • 直播做ppt的网站关键词排名哪里查
  • 温州 外贸网站制作杭州seo外包服务
  • 怎么提高网站响应速度知乎推广
  • wordpress问答插件哪个好专业搜索引擎优化电话
  • 做网站能赚钱吗表情包建立网站平台
  • 局域网视频网站建设点播系统互联网推广的优势
  • 宁波网站建设就业方向广告接单平台app
  • 网络维修电话详细描述如何进行搜索引擎的优化