Maintain resolution in the rendered rpict output image

Is there a way (parameter) in the rpict command so that to maintain the given resolution on the rendered image. At the moment while I am setting it to be 512x512 but this tends to change as you can see also from the warning below:

Rpict error: rpiece: warning - changed resolution from 512x512 to 504x512

The parameters I am using in rpict are:

-x 512 -y 512 -ab 2  -ad 256  -as 128  -aa 0  -dj 0.0 -ds 0.5  -dr 1  -dt 0.05 -ss 0  -st 1  -lw 0.0001  -lr 3 -pa 0.0 -ps 1 -pj 0.6  -pt 0.15 -t 10

If you run the rad command on a single view with -N set to 2 or greater, it will run rpiece instead of rpict and you may get this warning. This is due to rpiece breaking the image into tiles, which forces the image size to be evenly divisible into the requested number of tiles.

If you are running rpict directly, or do not use the rad -N option, then you will not get such a warning. However, rpict may resize the image if your horizontal and vertical view size (-vh -vv) do not agree. You can override this effort to produce square pixels by also setting -pa 0.

Hi @Greg_Ward, thanks for the response.

Yes indeed I am using rpiece since I am setting the -N param. As you suggest, I’ve seen the -pa param in the documentation and which I’ve set it to 0.0 (if you see in my initial message it is there) but the final output image is still resized. Params -vh and -vv do have the same value.

So the other option is to completely remove the -N setting as I understand?

Yes, remove the rad -N option if this warning bothers you. Another option is to specify the output resolution in the rad input file as:

RESOLUTION = 512 512 0

The third argument (0) forces the size to be met exactly. You will still see the warnings, but the final resolution out of pfilt (the final filtering stage) will be 512x512 exactly.

Is there a parameter to pass the third argument from command line, likewise to -x and -y params?

Are you using rad or not? If you want to set something on the command line, use:

rad -w [view, other options] input.rif "RESOLUTION=512 512 0"

The “-w” option turns off warning about reassigned variables. Your variable settings must follow the rad input file. You have not said what command(s) you are actually issuing.

Well I am using the Vi-Suite addon in blender. So the command that it runs under the hood is the following:

rpiece -t 10 -e "rpictprogress" -vh 57.296 -vv 57.296 -vd -0.939 0.036 -0.342 -x 512 -y 512 -X 24 -Y 1 -vp 1.279 1.824 2.473 -vu -0.342 0.013 0.940 -ab 2  -ad 256  -as 128  -aa 0  -dj 0.0  -ss 0  -st 1  -lw 0.0001  -lr 3  -pj 0.6  -pt 0.15  -ps 1 -pa 0.0 -ds 0.5  -dr 1  -dt 0.05 -o "image-1.hdr" "room_1-1.oct"

and based on this there is the option to provide custom parameters. The -N param is also set through the GUI. Thus, why I was asking whether I can specify the third argument by command line.

If they are running rpiece rather than having rad do it, then you may not have a choice. You can always run pfilt on the result to resize the image. I generally recommend doing so in any case, otherwise your image will not look very good. Render with -x 1024 -y 1024 then whatever rpiece resizes it to, take the output through:

pfilt -1 -x 512 -y 512 -pa 0 image-1.hdr > image-1filt.hdr

This should solve your problem and give you a nicer result as well.

Thanks Greg,

I will test it and update.

I can confirm that both suggested methods (removing the -N parameter and using directly rpict or using the command as it is with a higher resolution and then resizing with pfilt as Greg suggested) seem to work fine.