-
Notifications
You must be signed in to change notification settings - Fork 123
Export images with transparent background #2442
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
base: master
Are you sure you want to change the base?
Conversation
src/gui/print_widget.cpp
Outdated
| layout->addRow(world_file_check); | ||
| world_file_check->hide(); | ||
|
|
||
| transparent_background_check = new QCheckBox(tr("Make background transparent")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cannot enforce transparent background, but we can enforce white background.
Looking for feedback: Should this be
- White background
For formats without transparency, drawing the white background would be done implicitly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That change is indeed an option as making the background transparent is sometimes a unrealizable promise.
OTOH a user might wonder what happens if he deselects the checkmark: will the background be black (BTW: this happens if Mapper would allow transparency for .bmp) as he might not think about transparency?
So I personally have a preference for the current wording but I'm fine with the alternative.
src/gui/print_widget.cpp
Outdated
| && !path.endsWith(QLatin1String(".tif"), Qt::CaseInsensitive) && !path.endsWith(QLatin1String(".tiff"), Qt::CaseInsensitive) ) | ||
| { | ||
| transparent_background = false; | ||
| QMessageBox::warning(this, tr("Warning"), tr("Transparent background not supported for this file format.")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personaly I would prefer to avoid message box.
Changing the option as suggested might reduce the need for information. But at least a status bar notification would still be needed: Uninformed users might wonder why the background is always white in JPEG format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume that the average user of Mapper is a fast learner and notices how and why to avoid this dialog box being shown. I modified the dialog to be an information instead a warning and tell about the consequence (i.e., using a white background). At least a dialog is not so easy to be overseen.
|
@dg0yt: As proposed by you, I tried to use a status bar indication instead. However, this status bar indication won't be visible as it is (normally) immediately replaced by Another issue is that the 'Transparent background' setting is not saved in the map file - but neither is the 'Save world file' option (or 'Tiles' size in KMZ export).
What is your opinion? |
Add option to export .png and .tif(f) images with transparent background.
a024459 to
6bf1500
Compare
|
Pushing the minimal required set of changes. |
Add option to export .png and .tif(f) images with transparent background.