Google Maps Tile Cutter强迫白色背景
我正在使用传单。由于我无法使用内存使用量和放大的某些浏览器,因此我想使用两个瓷砖层。
这似乎很好地工作了,但是我唯一无法修复的就是让我的瓷砖变得透明。每当我使用Bramus的Tile Cutter脚本在Photoshop中剪切它们时,它会自动添加白色背景。
有人知道如何解决这个问题吗?
https:// https:///www.bram.us /2012/04/23/photoshop-google-maps-tile-cutter-script/
这就是我正在使用的脚本。
因此,基本上我想要的是瓷砖完全按照本脚本的方式切割,但是具有透明的背景。
我尝试通过使用ImageMagick去除白色背景,但这仍然使我在黑色区域周围的各种灰色阴影中都有一些像素,因此这也无法正常工作。
for /R "C:\Users\<USERNAME>\Desktop\map\name" %I in (*.png) do magick "%I" -fuzz 0.3%% -transparent #FFFFFF "%I"
我尝试添加-trim,但后来我仍然有箭头周围的边缘,有时(请参阅下面的原始图像)甚至用黑色的顶级订单删除了灰色区域。
无论如何,我的Photoshop脚本是否有其他选择,以便我仍然可以生成瓷砖但透明?我真的找不到一个。
I am using leaflet. Since I cannot use image-overlay due to memory usage and zooming being slow on some browsers I would like to use two tile-layers.
This seems to work perfectly, but the only thing I cannot fix is getting my tiles to be transparent. Whenever I cut them in Photoshop by using Bramus' tile cutter script it automatically adds a white background.
Does anyone know how to solve this?
https://www.bram.us/2012/04/23/photoshop-google-maps-tile-cutter-script/
That's the script I am using.
So basically what I want is the tiles being cut exactly as this script does, but with a transparent background.
I tried removing the white background by using ImageMagick but that still leaves me with some pixels in various shades of grey around the black area's unfortunately so that is not working either.
for /R "C:\Users\<USERNAME>\Desktop\map\name" %I in (*.png) do magick "%I" -fuzz 0.3%% -transparent #FFFFFF "%I"
After ImageMagick - added green BG for reference
I tried adding -trim, but then I still have edges around my arrows, and sometimes (see original image below) it even deleted the gray area with the black top-border.
Anyways, is there a alternative for my Photoshop script so I can still generate tiles but transparent? I couldn't really find one.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
昨天我偶然发现了这个问题,试图解决您面临的同样问题。
今天,我弄清楚了。不确定您是否仍然需要该解决方案,但是我会在此处将编辑发布到
ps_bramus.googlemapstilecutter.jsx
文件,以便证明此答案是合理的。我已经进一步修改了原始文件,因为我只想要具有透明度选项的PNG,并且不在乎其他任何设置。即使在评论背景颜色的内容之后,白色背景也发生了,是因为“扁平图像”迫使其背后的白色。如果将其取出并删除所有设置背景颜色的东西,它最终将是透明的。
I stumbled upon this question yesterday while trying to solve the same problem you are facing.
Today, I figured it out. Not sure if you still want the solution, but I'll post the edits here to the
PS_Bramus.GoogleMapsTileCutter.jsx
file so it justifies this answer. I have modified the original file further because I ONLY want the PNG with transparency option and don't care about any of the other settings.The reason the white background happens, even if after commenting out the background color stuff, is because the "flatten image" forces white behind it. If you take that out and remove all of the setting the background color stuff, it will end up being transparent.