考虑(或不考虑)h / v分辨率的图像大小 [英] Image size considering (or not) h/v resolution

查看:263
本文介绍了考虑(或不考虑)h / v分辨率的图像大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两张图片:

Name   Type  Width  Height  HRes  VRes  
img01  GIF   256    256     384   96  
img02  TIFF  1728   1147    200   100

Windows内部查看器使用不同的模式显示它们

Windows internal viewer shows them using different patterns:


  • img01 显示为256x256图像(方形)

  • img02 显示为垂直图像(尽管宽度>高度)且图像格式正确

  • img01 is displayed as 256x256 image (square)
  • img02 is displayed as a vertical image (despite of width>height) and image format is correct

在看到 img02 行为后,我认为显示的尺寸由下式给出:

After seen img02 behaviour I thought that displayed size is given by:

Display_Width  = max(HRes,VRes) * Width / HRes
Display_Height = max(HRes,VRes) * Height / VRes



<但是这对于 img01 来说并不好,它显示为256x256 !!

如果我使用图像类加载那些我mages,分辨率不考虑,所以 img02 水平显示,并且尊重正确的格式。

如果Windows内部查看器正确显示它们,我认为应该有一些属性了解是否应该考虑解决方案。

使用图像类我有标志 PropertyItems 属性,但我真的不明白他们是否是我要看的人。

But that's not good for img01, which is displayed as 256x256!!
If I use Image class to load those images, resolution is not taken in account, so img02 is shown horizontally and distorced respect correct format.
If Windows internal viewer shows them correctly, I think there should be some property to understand if resolution should be considered or not.
With Image class I have Flags and PropertyItems properties, but I really don't understand if they are the ones I have to look at.

你能教我正确的方法来显示图像(使用Image类)而不会失真吗?

谢谢

Can you teach me the right method to display images (using Image class) without distortion?
Thanks

推荐答案

GIF文件中的宽高比非常罕见,因为GIF是一种用于存储要在计算机屏幕上显示的图形的格式。实际上,GIF87a文件根本没有宽高比,GIF89a不存储实际的宽高比,而是近似值。

Aspect ratio in GIF files is very uncommon, since GIF is a format used to store graphics intended to be displayed on computer screens. In fact, GIF87a files do not have an aspect ratio at all, and GIF89a do not store the actual aspect ratio but an approximation.

另一方面,TIFF文件为大部分都是由平面设计师,摄影师和出版商使用,因此像素长宽比的概念是格式的核心,因为它允许这些文件在不同的显示媒体之间移动。

On the other side, TIFF files for the most part are used by graphic designers, photographers and publishers, so the concept of pixel aspect ratio is core to the format as it allows these files to move between different display mediums.

我的猜测是大多数GIF解码器都忽略了GIF89a格式的宽高比。我想你也应该这样做。

My guess is that most GIF decoders ignore the aspect ratio from the GIF89a format. I think you should do the same.

这篇关于考虑(或不考虑)h / v分辨率的图像大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆