Improvements for image.save() #202
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi Chris,
I wanted to use image.clip() and image.save() to split a tilemap into tiles but realized, that it was not possible. I did some improvements to the image save function. Now you can do the following:
Especially the last line was not possible. When a variable was passed as an argument, the variable was always transformed to an array and the image values were returned in this array. When now a string-variable with a file name is given as an argument, the file will be save to that file name.
Additionally when saving to an array, the settings of image.clip will be applied instead of returning the full image.
At the moment I did it only for image.cpp in the ui folder. If you like the changes, I can also rewrite the console part.
Best regards, Joerg