change the canvas size without changing the image size?

Wondering how to accomplish a certain animation task? Ask here.

Moderators: Víctor Paredes, Belgarath, slowtiger

User avatar
synthsin75
Posts: 10045
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: change the canvas size without changing the image size?

Post by synthsin75 »

Everything in Moho, like stroke width, etc., is relative to the project height. So changing the project height normalizes everything to that new dimension. This isn't a bug, because you generally want the same image size, stroke weight, etc. if you export the same project to standard (4:3) or widescreen (16:9). If those things were altered by project width, the result would not be consistent when exported for different horizontal aspect ratios.

You can solve your problem by either following my above steps or using this menu script on all selected image layers:

Code: Select all

-- **************************************************
-- Provide Moho with the name of this script object
-- **************************************************

ScriptName = "Syn_NormalizeImages"

-- **************************************************
-- General information about this script
-- **************************************************

Syn_NormalizeImages = {}

function Syn_NormalizeImages:Name()
	return "Normalize Images"
end

function Syn_NormalizeImages:Version()
	return "1.0"
end

function Syn_NormalizeImages:Description()
	return "Normalize selected images scaled by project dimension change"
end

function Syn_NormalizeImages:Creator()
	return "(c)2021 J.Wesley Fowler (SynthSin75)"
end

function Syn_NormalizeImages:UILabel()
	return "SYN: Normalize Images"
end

-- **************************************************
-- The guts of this script
-- **************************************************

function Syn_NormalizeImages:Run(moho)
	moho.document:PrepUndo(moho.layer)
	moho.document:SetDirty()
	
	local count = 0
	repeat
		local layer = moho.document:LayerByAbsoluteID(count)
		count = count+1
		if (layer) then
			if (layer:LayerType() == MOHO.LT_IMAGE) and (layer:SecondarySelection()) then
				local source = moho:LayerAsImage(layer):SourceImage()
				moho:LayerAsImage(layer):SetSourceImage(source)
			end
		end
	until (not layer)
end
superonIII
Posts: 67
Joined: Tue Sep 27, 2011 12:31 pm
Location: london

Re: change the canvas size without changing the image size?

Post by superonIII »

thanks, i don't really understand all that so i'm going to assume we're both right, it's not a bug but it is super annoying.

currently changing all the images and vectors to fit the new export height is a pain when it's been animated by points from reference layers.
many more images in this file too so will probably need to make use of that script too.
Image
superonIII
Posts: 67
Joined: Tue Sep 27, 2011 12:31 pm
Location: london

Re: change the canvas size without changing the image size?

Post by superonIII »

https://imgur.com/GvSB1uQ
this feels more inconsistent to me
Image
superonIII
Posts: 67
Joined: Tue Sep 27, 2011 12:31 pm
Location: london

Re: change the canvas size without changing the image size?

Post by superonIII »

after thinking slightly harder about this, but admittedly not much, i think it'll be easier to simply rotate the whole project through 90 degrees and export it sideways. i need to run it through either gimp or photoshop after exporting anyway and they can both rotate through 90degrees too :)
Image
User avatar
hayasidist
Posts: 3586
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: change the canvas size without changing the image size?

Post by hayasidist »

Greenlaw wrote: Tue Jun 01, 2021 7:18 pm Basically, Moho's Dimensions is adjusting the project's resolution, not the canvas size. It's like the difference between the Image Size and Canvas Size settings in Photoshop. Unfortunately, Moho doesn't really have the latter.
well -- Moho doesn't have a canvas size because it's "infinite" (well huge anyway -- you can draw way way way outside the viewport just by zooming and panning the view of the workspace -- it's simple to place a vector object at (e.g.) x,y = {12000,12000} (not so easy to find it if you do though! :wink: ). So, for me, the issue is one of being able to preserve the size of an imported image if the output resolution changes... but I'm not sure if/how Moho adjusts the image pixel dimensions on import?
User avatar
slowtiger
Posts: 6098
Joined: Thu Feb 16, 2006 6:53 pm
Location: Berlin, Germany
Contact:

Re: change the canvas size without changing the image size?

Post by slowtiger »

Moho imports pixel dimensions 1:1 - if you set your project dimensions to 1000 x 1000 and import an image of that size it will fit perfectly and export at the same size. However, if you change your project properties to 2000 x 2000 the same image imported will have half the size of the first. Also bear in mind that you can change the Z value of anything (changing the size), and that any positioning can happen in subdivisions of a pixel. So don't expect to get a really exact copy of your image from an exported Moho render.
AS 9.5 MacPro Quadcore 3GHz 16GB OS 10.6.8 Quicktime 7.6.6
AS 11 MacPro 12core 3GHz 32GB OS 10.11 Quicktime 10.7.3
Moho 13.5 iMac Quadcore 2,9GHz 16GB OS 10.15

Moho 14.1 Mac Mini Plus OS 13.5
User avatar
Greenlaw
Posts: 9534
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: change the canvas size without changing the image size?

Post by Greenlaw »

hayasidist wrote: Wed Jun 02, 2021 9:50 am well -- Moho doesn't have a canvas size because it's "infinite"...
Ah, yeah, you're right. That's basically how it works in 3D programs, i.e., you're defining the region the camera sees of an 'infinite' world...which is probably why my '3D trick' involving the camera lens to extend the boundary while preserving the image resolution/position works in Moho. (I did a quick test yesterday, and it seems to work fine in Moho too.)

IMO, it's not a big deal to apply the formula; I did this all the time for calculating render overscan in the 3D program I use, before it got a built-in feature to do this automatically. Having this feature in Moho isn't something I'd use often myself, but I see how it could be very useful to some users.
Post Reply