Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PNG images change size on restart #3374

Closed
dancs2520 opened this issue Jul 1, 2020 · 6 comments
Closed

PNG images change size on restart #3374

dancs2520 opened this issue Jul 1, 2020 · 6 comments

Comments

@dancs2520
Copy link

Describe the bug
I am new with OpenToonz and I came across this weird behavior that (I believe) is not intentional.
I have a project that consists basically of png images moving around the screen.
I did not resized any of them, since they are already on the right size and scales.
After I set my scene I save and close the program.
On reopen, some of the png images are randomly resized, even though the scale still appears as 100%, it just seems bigger on the canvas.
I found out that if I import such image again, selecting "replace..", into a new layer, deleting this new layer, saving and reopening OpenToonz, the scales are back to normal.

To Reproduce
List steps to reproduce the behavior.

  1. I am not sure how to reproduce the behavior, sometimes it happens and sometimes it doesn't, not necessarily with the same png images.
  2. My png images are all exported from inkscape and with sizes ranging from 1 to 450kb (not sure if this is relavant)

Expected behavior
I expect that the sizes would always appear the same way on the screen

Screenshots
I am not sure which screenshots would be useful, I can try to capture the screen with the wrong sizes...

Device Information:

  • OS: Windows 10 v1909
  • OpenToonz Version:Nightly (2020-06-30)
  • GPU: Intel HD graphics 4600
  • GPU Driver Version: 20.19.15.5107
@artisteacher
Copy link
Contributor

I would check in the Function Editor & see if there are any unexpected keyframes. There's an arrow on each "folder icon" if there are any keyframes in that area. The "Z" (depth) value in particular can make drawings appear bigger or smaller.

@shun-iwasawa
Copy link
Member

I'm not sure but it may be because some PNG images are with wrong DPI in the scene.
Please check the DPI field in the level settings of problematic level and see if it has the same value as the ones with proper size.

[To open level settings]

  • Right click the cell and select Level Settings from the context menu.

If the problem was related to DPI, it would be worth considering using a pixel unit as long as you work with PNG.

[To change the unit to pixels]

  • Select Menubar -> File -> Preferences .
  • In the preferences popup, check Pixels Only option in the Interface category.

@dancs2520
Copy link
Author

Thank you guys for the suggestions!

@artisteacher , I have checked the function editor and it looks fine to me... I do have some animation using the Z axis for the camera, but only there (and if that were causing the problem, I think it would affect every element on the scene, not just a random one)...

@shun-iwasawa , I have just selected Pixels Only as you said, although I am not sure if that would do it since I was extra careful to always set the DPI to 120 on Inkscape before exporting each file. Anyway, I will keep an eye for the next couple of days to see if the problem is fixed and will let you know.

@shun-iwasawa
Copy link
Member

In reference to DPI in PNG file:
PNG format does not include accurate DPI information. Instead, it has an optional header storing "pixels amount per 1 metre" in 4-byte integer value.
I guess the DPI set in Inkspace is converted to "pixels per metre" value (120 / 0.0254 = 4724.409... but truncated to 4724). You can find the DPI value slightly lower than 120 (like 119.99) when you load it in other software like PhotoShop due to truncation.
To return to our subject, for now OpenToonz rounds-off such PNG's "approximative" dpi information (i.e. converting 4724 * 0.0254 = 119.9896 back to 120) which would work OK as long as you use integer value of DPI.

@dancs2520
Copy link
Author

@shun-iwasawa , thank you for this info, I did not know that. Since I checked "Pixels Only" I haven't seen the problem happening again. Maybe that did the trick?

@dancs2520
Copy link
Author

It looks like something suggested in here really solved my problem since I haven't seen the problem again. Thank you all for the help, I am now closing the thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants