在图形数据视图中剔除像素的算法?

发布于 2024-10-09 17:05:50 字数 155 浏览 0 评论 0原文

我正在编写一个 wxpython 小部件,它显示多个对象随时间(x 个周期)的状态。现在我让它以 1 像素/周期工作,并放大和缩小到 1:1;但我想允许缩小。我想看看是否有任何首选算法可以在我开始仅使用自己微弱的启发式方法来滚动/组合数据之前。是否有这样的算法,或者我应该开始编写自己的解决方案?

I'm writing a wxpython widget which shows the state of several objects over time (x cycles). Right now I have it working with 1 pixel/cycle and zooming in and back out to 1:1; but I would like to allow zooming out. I wanted to see if there are any go-to algorithms for thowing away/combining data before I started rolling my own using only my own feeble heuristics. Is there any such algo, or should I just start coding my own solution?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一杯敬自由 2024-10-16 17:05:50

很大程度上取决于您要调整大小的图像类型。请参阅无限的神话详细信息:双线性与双三次更好的图像调整大小< /a> 由我们自己的 Jeff 创作!在那里您可以比较朴素最近邻的结果,双线性过滤双三次过滤, 双三次锐化真正的分形

杰夫的结论:

减少图像是完全安全的
并合理运作。你简直就是
降低精度和分辨率
丢弃信息。制作图像
只要你想要那么小,你就有了
完全保真——在界限之内
您拥有的像素数
a>允许。你会得到好的结果 不
无论您选择哪种算法。
(好吧,除非你选择中枢 Pixel
调整大小或最近邻
算法。)

放大图像是有风险的。超越
某些点,放大图像是
愚蠢的差事;你不能神奇地
s>合成无数新的
凭空出现的像素。和
插值像素永远不会那么好
作为真实像素。这就是为什么它更多
而不是稍微人为地扩大
512x512 Lena 图像放大 500%。本来就是
更聪明地找到更高分辨率
您需要的任何内容的扫描件或图片*
比扩大它的尺寸
软件。

但是当你无法避免放大
图像,那就是知道的时候了
双三次、双线性之间的权衡,
以及更先进的调整大小算法。
至少武装自己足够
知识挑选最好的坏的
您拥有的选项。

Depends a lot on what type of images you're resizing. See The myth of infinite detail: Bilinear vs. Bicubic and Better Image Resizing by our very own Jeff! There you can compare results of naive nearest neighbor, bilinear filtering, bicubic filtering, bicubic sharper and genuine fractals.

Jeff's conclusion:

Reducing images is a completely safe
and rational operation. You're simply
reducing precision and resolution by
discarding information. Make the image
as small as you want, and you have
complete fidelity-- within the bounds
of the number of pixels you've
a> llowed. You'll get good results no
matter which algorithm you pick.
(Well, unless you pick the nave Pixel
Resize or Nearest Neighbor
algorithms.)

Enlarging images is risky. Beyond a
certain point, enlarging images is a
fool's errand; you can't magically
s> ynthesize an infinite number of new
pixels out of thin air. And
interpolated pixels are never as good
as real pixels. That's why it's more
than a little artificial to upsize the
512x512 Lena image by 500%. It'd be
smarter to find a higher resolution
scan or picture of whatever you need*
than it would be to upsize it in
software.

But when you can't avoid enlarging an
image, that's when it pays to know the
tradeoffs between bicubic, bilinear,
and more advanced resizing algorithms.
At least arm yourself with enough
knowledge to pick the best of the bad
options you have.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文