Issue 124841 - Image antialiasing not working on upgrade to 4.1.0 - problem persists in 4.2.0
Summary: Image antialiasing not working on upgrade to 4.1.0 - problem persists in 4.2.0
Status: CONFIRMED
Alias: None
Product: Writer
Classification: Application
Component: viewing (show other issues)
Version: 4.1.0
Hardware: PC Linux 64-bit
: P3 Major (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2014-05-07 06:00 UTC by J
Modified: 2020-10-25 22:23 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: 4.2.0-dev
Developer Difficulty: ---


Attachments
Appearance of image at 200% in Writer OO4.0.1 (144.86 KB, image/png)
2014-05-16 02:39 UTC, J
no flags Details
Appearance of image at 200% in Writer OO4.1.0 (97.41 KB, image/png)
2014-05-16 02:41 UTC, J
no flags Details
Document with image whose quality degrades 4.0.1->4.1.0 (68.84 KB, application/vnd.oasis.opendocument.text)
2014-05-16 02:48 UTC, J
no flags Details
Sample ODT Document with a png on 4.0.1 (272.53 KB, image/png)
2014-10-01 20:21 UTC, Gabriel Pereira Borges
no flags Details
Sample ODT Document with a png on 4.1.0 (same for 4.1.1) (218.02 KB, image/png)
2014-10-01 20:22 UTC, Gabriel Pereira Borges
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description J 2014-05-07 06:00:31 UTC
On upgrade from 4.0.1 to 4.1.0 on Ubuntu 12.04LTS images within a document are no longer antialiased during document navigation.  This is despite 'antialias images' being switched on in the program options.  When downgraded back to 4.0.1, the problem disappeared, i.e this appears to be a regression.
Comment 1 Ariel Constenla-Haile 2014-05-11 06:00:30 UTC
Can you attach a sample document, and a screenshot of how it looks like on your system?
Comment 2 J 2014-05-16 02:39:32 UTC
Created attachment 83397 [details]
Appearance of image at 200% in Writer OO4.0.1

This is the appearance of an image in Open Office Writer 4.0.1 under Ubuntu 12.04.
Comment 3 J 2014-05-16 02:41:21 UTC
Created attachment 83398 [details]
Appearance of image at 200% in Writer OO4.1.0

This is an image whose representation on the screen is degraded upon upgrade to OO4.1.0 under Ubuntu 12.04.
Comment 4 J 2014-05-16 02:48:41 UTC
Created attachment 83399 [details]
Document with image whose quality degrades 4.0.1->4.1.0
Comment 5 Ariel Constenla-Haile 2014-05-16 20:12:49 UTC
Confirmed Fedora 20 with the attached document
Regression from 4.0.1
Setting Armin on CC
Comment 6 Armin Le Grand 2014-06-16 12:51:22 UTC
Adding Herbert to CC. Herbert, any changes on Linux Bitmap drawing between 4.0.1 and 4.1.0...?
Comment 7 hdu@apache.org 2014-06-17 08:35:01 UTC
From AOO40x->AOO410 Linux bitmap drawing was modified with your changes for bug 122778 ("Linux display quality of transformed bitmaps needs improvement) or eventually bug 124002. These are the most likely candidates for this regression. Simply reverting the changes to test this doesn't work because interfaces change.

Why the problem was not visible on gdiplus and quartz may have to do with the default scaling method in each backend.
Comment 8 Armin Le Grand 2014-06-18 16:38:37 UTC
Grepping...
Comment 9 Armin Le Grand 2014-06-20 13:23:39 UTC
Debugging. The paint uses simply fallback to OutputDevice::DrawBitmap() which leads to X11SalGraphics::drawBitmap and X11SalGraphics::ImplDraw. At the involved OutputDevice, mnAntialiasing == 2 which means ANTIALIASING_ENABLE_B2DDRAW.

@Herbert: Shouldn't this paint the bitmap AAed as expected?
Comment 10 Armin Le Grand 2014-06-20 13:37:53 UTC
I forgot: The same pic in draw/impress shows the same behaviour, thus this is independent of the changes done in Writer for unifying the graphics rendering.
Comment 11 Armin Le Grand 2014-06-20 14:10:28 UTC
Compared on xubuntu64bit AOO400 and trunk version: When the graphic needs to be compressed (e.g. 70% display zoom), both look bad. When scaled bigger than original (150%) the old version smoothes (somewhat), the trunk version does not, just unequal line/column doubling which looks bad.
Thus there is indeed a difference somewhere. Debugging AOO400 version what was used there...
Comment 12 Armin Le Grand 2014-06-23 08:17:34 UTC
Loked deeper and indeed the difference is that the old specialized preparation with the GraphicManager paint did the hand-crafted scaling in an own form. The now unified paint is using the default VCL-Based OutputDevice::DrawBitmap which is not AAing on linux at all. The way go get out of this is to enhance the standard VCL bitmap output for Linux.

@Herbert: Is there a simple/overseeable way to get Bitmap/BitmapEx painted with better quality using VCL on Linux? You have a much better overview of the stuff currently done there.
Comment 13 hdu@apache.org 2014-06-23 09:42:31 UTC
(In reply to Armin Le Grand from comment #12)
> Loked deeper and indeed the difference is that the old specialized
> preparation with the GraphicManager paint did the hand-crafted scaling in an
> own form. The now unified paint is using the default VCL-Based
> OutputDevice::DrawBitmap which is not AAing on linux at all. The way go get
> out of this is to enhance the standard VCL bitmap output for Linux.

With your changes in revision 1403434 the default bitmap scaling has changed form BMP_SCALE_FAST to BMP_SCALE_SUPER ("supersampling"), which IMHO shouldn't be considered an interpolating algorithm. Most other scaling methods result in much nicer looking images. Resampled preview images with an almost matching size also look much nicer, even when only supersampling are used.

In our plain X11 backend the native XCopyArea function is used, which doesn't care at all about antialiasing. And if visual quality is a concern then that function's scaling ability should be avoided. Until your changes for AOO410 (such as issue 122778) this wasn't the case.

I agree that the image scaling functionality on our X11 backend should be improved to better handle image scaling itself, especially when antialiasing is enabled. But for this particular regression I'm afraid we need a solution that gets the old quality back ASAP.
Comment 14 Armin Le Grand 2014-06-23 09:53:09 UTC
@Herbert: Does this mean that VCL's implementation of X11 bitmap painting cannot/does not scale at all, so that the image that needs to be painted has to be prepared in the target pixel resolution? If yes and if X11 is able to *do* scaling we should consider to use it. Of course we could use own software-based scaling as preprocessing for painting (and thus could control quality), but this is an expensive and not modern solution which I would definitely want to avoid. There *must* be something better nowadays which uses available graphics hardware, even under Linux, don't you think?
Comment 15 Gabriel Pereira Borges 2014-10-01 20:21:07 UTC
Created attachment 84006 [details]
Sample ODT Document with a png on 4.0.1

I can also confirm the issue on Ubuntu 12.04.5 LTS 64 bits.

Linux gpborges 3.13.0-36-generic #63~precise1-Ubuntu SMP Thu Sep 4 22:28:20 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

I'm stuck on 4.0.1 because if I upgrade to 4.1.x (4.1.0, 4.1.1) the images are bad. I'm attaching 2 sample images so that you guys can see it.
Comment 16 Gabriel Pereira Borges 2014-10-01 20:22:52 UTC
Created attachment 84007 [details]
Sample ODT Document with a png on 4.1.0 (same for 4.1.1)
Comment 17 J 2016-05-11 11:48:03 UTC
I originally reported this problem in 4.1.0 however it still is present in the 4.2.0 developer build using an updated OS (Ubuntu 15.10).  The absence of antialiasing on the linux build is a usability issue, not just a cosmetic one, as it makes it impossible to work properly with documents with small fonts and images with fine detail.
Comment 18 Marcus 2017-05-20 11:01:01 UTC
Reset assigne to the default "issues@openoffice.apache.org".