Image width and height must be multiple of four как исправить

I’m trying to convert a JPEG image to a DDS file format in Adobe Photoshop CC; when I keep saving it keeps showing me a message that says:

image width and height must be multiple of four

The image I’m trying to use is 2000 x 1330, image size is 2.86 MB. What does this mean? And how can I make this work?

I’m using the NVIDIA plug in. What does this mean — I need six images side by side and width should equal height. Must the height be in powers of two?

slhck's user avatar

slhck

221k70 gold badges599 silver badges590 bronze badges

asked Dec 6, 2013 at 6:31

user279668's user avatar

image width and height must be multiple of four

2000 / 4 = 500
1330 / 4 = 332.5

So, your height is not in multiples of four. You need 1332 or 1328 as height in order to be able to convert it.

answered Dec 6, 2013 at 12:33

slhck's user avatar

slhckslhck

221k70 gold badges599 silver badges590 bronze badges

1

Oddbob

New Here

,

/t5/premiere-pro-discussions/image-width-and-height-must-be-multiple-of-four-error-cs6/td-p/10356483
Jan 31, 2019
Jan 31, 2019

Copy link to clipboard

Copied

I am getting this error with dds images, eventhough the resolution for both width and height are multiples of four.  So not sure why I am getting this error?

  • Follow
  • Report

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

community guidelines

replies
3
Replies
3

John T Smith

Community Expert

Community Expert

,

/t5/premiere-pro-discussions/image-width-and-height-must-be-multiple-of-four-error-cs6/m-p/10356484#M201244
Feb 01, 2019
Feb 01, 2019

Copy link to clipboard

Copied

I only use JPG, so what is a DDS image?

  • Follow
  • Report

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

community guidelines

Oddbob

New Here

,

/t5/premiere-pro-discussions/image-width-and-height-must-be-multiple-of-four-error-cs6/m-p/10356485#M201245
Feb 01, 2019
Feb 01, 2019

Copy link to clipboard

Copied

In Response To John T Smith

It is a direct draw surface, that is used in video games.

  • Follow
  • Report

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

community guidelines

John T Smith

Community Expert

Community Expert

,

/t5/premiere-pro-discussions/image-width-and-height-must-be-multiple-of-four-error-cs6/m-p/10356486#M201246
Feb 02, 2019
Feb 02, 2019

Copy link to clipboard

Copied

LATEST

In Response To Oddbob

  • Follow
  • Report

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

community guidelines

Oddbob

New Here

,

/t5/premiere-pro-discussions/image-width-and-height-must-be-multiple-of-four-error-cs6/td-p/10356483
Jan 31, 2019
Jan 31, 2019

Copy link to clipboard

Copied

I am getting this error with dds images, eventhough the resolution for both width and height are multiples of four.  So not sure why I am getting this error?

  • Follow
  • Report

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

community guidelines

replies
3
Replies
3

John T Smith

Community Expert

Community Expert

,

/t5/premiere-pro-discussions/image-width-and-height-must-be-multiple-of-four-error-cs6/m-p/10356484#M201244
Feb 01, 2019
Feb 01, 2019

Copy link to clipboard

Copied

I only use JPG, so what is a DDS image?

  • Follow
  • Report

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

community guidelines

Oddbob

New Here

,

/t5/premiere-pro-discussions/image-width-and-height-must-be-multiple-of-four-error-cs6/m-p/10356485#M201245
Feb 01, 2019
Feb 01, 2019

Copy link to clipboard

Copied

In Response To John T Smith

It is a direct draw surface, that is used in video games.

  • Follow
  • Report

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

community guidelines

John T Smith

Community Expert

Community Expert

,

/t5/premiere-pro-discussions/image-width-and-height-must-be-multiple-of-four-error-cs6/m-p/10356486#M201246
Feb 02, 2019
Feb 02, 2019

Copy link to clipboard

Copied

LATEST

In Response To Oddbob

  • Follow
  • Report

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

community guidelines

Материал из MODFAQ.RU — моддинг игр серии S.T.A.L.K.E.R., The Elder Scrolls и Fallout

NVIDIA Texture Tools

Разработчик NVIDIA
Версия 8.55 от 14 января 2013 (10 лет)
Тип Плагин
Платформа Adobe Photoshop
Форматы файлов *.dds
Официальный сайт nvidia.com

NVIDIA Texture Tools[1] — это плагин от NVIDIA для графического редактора Adobe Photoshop с собранием утилит для работы с текстурами.

Ссылки на скачивание
NVIDIA Texture Tools

32-bit
https://developer.nvidia.com/sites/default/files/akamai/tools/files/Photoshop_Plugins_8.55.0109.1800.exe

64-bit
https://developer.nvidia.com/sites/default/files/akamai/tools/files/Photoshop_Plugins_x64_8.55.0109.1800.exe

Состав

  • Normal Map фильтр

NVIDIA-Normal-Map-filter-Screenshot.jpg

  • DDS плагин

NVIDIA-DDS-plug-in-Screenshot.jpg

  • Скрипт генерации mip-map
  • Скрипт форматирования Cube Map

Установка

Запустите инсталлятор, и установите в корневую директорию Adobe Photoshop.

Совместимость

Поддерживаются следующие версии Adobe Photoshop:

  • 5.0, 5.1, 6.0, 7.0, CS, CS2, CS3, CS4, CS5, CS6

В версии Adobe Photoshop CC, не работает Normal Map фильтр.

В качестве альтернативы, можете попробовать использовать встроенный в CC фильтр, выбрав в панели инструментов: Фильтр -> 3D -> Создать карту нормалей или рельефа (Объект: Карта текстуры)

Возможные ошибки и их исправление

image width and height must be multiple of four
image width and height must be multiple of four

Ошибка

Возникает при попытке сохранить .dds текстуру в формат DXT5.

Решение

Размер текстуры должен соответствовать степени двойки, т.е. например:
256х256
128х256
1024×512
2048×1024
и т.д.

Источники

  1. Страница “NVIDIA Texture Tools for Adobe Photoshop” на сайте nvidia.com

It’s not unusual for the “compressed” sizes of game textures to be larger than the source asset files, because the compression formats we use at runtime in games need to be GPU-readable.

I go into more detail about this in other answers, but to be brief:

  • Typical compression formats we use for source assets or images on the web (PNG, JPG) can use variable bit rates: taking predictable areas of the image and compressing them more, while complex parts of the image use more raw data. They’re also decompressing the whole image at once, so they can use information from one part of the image to make predictions to better compress other parts of the image.

  • When rendering an image with a GPU, you need random access. A shader core needs to be able to ask “What’s the colour at pixel (154, 1011)?” and the texture unit needs to know the exact position in memory to find that and be able to answer the question fast, without taking the time to read distant parts of the image to work out the correct decompression table.

That unfortunately means compression for game assets isn’t as good by many metrics as PNG/JPG. We generally have to deal with larger memory footprints, and as we try to crunch down the file size we see visible quality loss much faster, because the more aggressive compression algorithm hits all parts of the image, not just the smooth compressible parts.

For that reason, images that are very sensitive to being displayed just-so, like 2D sprites and UI images, will be saved in an uncompressed format, so you don’t get the visual degradation that comes with GPU texture compression. That’s why changing the image type to “Sprite (2D and UI)” makes the file size double in your case.

0.7 MB is still not that bad in an era when GPU have gigabytes of fast video RAM, and even most phones have access to multiple gigabytes of shared RAM, but it can add up over a large game, or if you’re trying to really crunch your download size. See advice for reducing Unity build size, including use of asset bundles and addressables for some ideas there.


The next bit is just math. If you try to save a 724×1044 image at “Max size 1024”, then that height has to change, since 1044 is greater than 1024.

So, following your instructions, Unity scales down the image proportionately, so the height is 1024 (the max allowed), and the width keeps the original 181:261 ratio of the original as best it can. 1024 * 724/1044 = 710.130… which rounds to 710, so you get an image that’s 710×1024.

1024 divides evenly by 4, but 710 does not (it’s 2 * 355 – no more prime factors of 2 left). So the error message is accurately telling you that it cannot compress the image using ETC2 at the size you’ve specified.

To fix this, try manually scaling your image (or cropping if necessary) to a desired size that fits the multiple-of-4 criterion. Adding two single-pixel-wide columns of padding or slightly stretching the aspect ratio to 712×1024 would be enough.

If this image is used as a sprite or UI image, then you may also be able to store it in a larger 2048×2048 image and use the extra space to store other sprites – something called a Sprite Atlas. Then each image inside that meta-image is free to have whatever strange dimensions it wants, as long as it doesn’t overlap with its neighbours. Unity has features to automatically pack your assets together into atlases, which can also speed up drawing by reducing state switching between content that’s drawn back-to-back.

Добавить комментарий