Bug 80385 - Poor image quality (bad resampling) in Draw
Summary: Poor image quality (bad resampling) in Draw
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
(earliest affected) release
Hardware: All All
: medium major
Assignee: Not Assigned
Keywords: bibisected, bisected, regression
: 75715 (view as bug list)
Depends on:
Blocks: Draw-Images
  Show dependency treegraph
Reported: 2014-06-23 09:48 UTC by Kevin Suo
Modified: 2017-11-27 20:05 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:

test pdf file (86.55 KB, application/pdf)
2014-06-23 09:48 UTC, Kevin Suo
Colors vs Grayscale (203.60 KB, image/png)
2014-06-23 13:49 UTC, Firas Hanife
Image extracted from test pdf (173.78 KB, image/png)
2014-09-14 12:45 UTC, vvort

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Suo 2014-06-23 09:48:25 UTC
LibreOffice imports pdf file with images in it with very poor quanlity.

Steps to reproduce:
1. Open the attached test pdf file in your pdf reader, and observe the image quanlity;
2. Open the test pdf file with libreoffice draw and observe the poor image quanlity.

The test pdf file was scanned from Toshiba scanner. This happens to all sanned pdfs.

I am aware that this may be because libreoffice is reducing the image resolution to make it faster to load pdf files, but anyway it should not make the pdf un-readable (and importing large pdf with many images in it is always slow and may cause libreoffice crash sometimes, which is another bug).

OS: Windows XP SP3
Comment 1 Kevin Suo 2014-06-23 09:48:55 UTC
Created attachment 101566 [details]
test pdf file
Comment 2 Firas Hanife 2014-06-23 13:45:05 UTC
Reproduced with, and on openSUSE.
The issue is not present on

Basically to avoid this issue it is needed to change View > Color/Greyscale > Grayscale.
The image included in the PDF is scanned as black & white.

Changing Status to NEW and updating affected LibreOffice Version.
Comment 3 Firas Hanife 2014-06-23 13:49:42 UTC
Created attachment 101591 [details]
Colors vs Grayscale
Comment 4 Xisco Faulí 2014-06-24 16:19:28 UTC
bibisected as deep as possible. I skipped some commits as the pdf's background was black:

There are only 'skip'ped commits left to test.
The first bad commit could be any of: 69bf614869471f46413fe1d2af5976b2e6d85084 fa729323917d7e0d45129bc21c08d8e19faab69b 70cea68b2de84c293ea8adbe2de81f75c23d0beb 89d00e8a0afc7c82d82ff03a140cfb2c0555e595 5997ef2caf7fc40b8899eab0100042836d2db030
We cannot bisect more!

# bad: [423a84c4f7068853974887d98442bc2a2d0cc91b] source-hash-c15927f20d4727c3b8de68497b6949e72f9e6e9e
# good: [65fd30f5cb4cdd37995a33420ed8273c0a29bf00] source-hash-d6cde02dbce8c28c6af836e2dc1120f8a6ef9932
git bisect start 'latest' 'oldest'
# good: [e02439a3d6297a1f5334fa558ddec5ef4212c574] source-hash-6b8393474974d2af7a2cb3c47b3d5c081b550bdb
git bisect good e02439a3d6297a1f5334fa558ddec5ef4212c574
# bad: [4850941efe43ae800be5c76e1102ab80ac2c085d] source-hash-980a6e552502f02f12c15bfb1c9f8e6269499f4b
git bisect bad 4850941efe43ae800be5c76e1102ab80ac2c085d
# skip: [a043626b542eb8314218d7439534dce2fc325304] source-hash-9379a922c07df3cdb7d567cc88dfaaa39ead3681
git bisect skip a043626b542eb8314218d7439534dce2fc325304
# skip: [aba65c3e4c0df07e4909aeefb758cdb688242bf6] source-hash-827524abfb4b577d08276fde40929a9adfb7ff1a
git bisect skip aba65c3e4c0df07e4909aeefb758cdb688242bf6
# skip: [aba65c3e4c0df07e4909aeefb758cdb688242bf6] source-hash-827524abfb4b577d08276fde40929a9adfb7ff1a
git bisect skip aba65c3e4c0df07e4909aeefb758cdb688242bf6
# bad: [c81a8a0dcfc1ed095a80e4485c89dd0fcaf73f31] source-hash-c69ed33628ec0b7abf6296539cf280d6c4265930
git bisect bad c81a8a0dcfc1ed095a80e4485c89dd0fcaf73f31
# bad: [c81a8a0dcfc1ed095a80e4485c89dd0fcaf73f31] source-hash-c69ed33628ec0b7abf6296539cf280d6c4265930
git bisect bad c81a8a0dcfc1ed095a80e4485c89dd0fcaf73f31
# bad: [1d4980621741d3050a5fe61b247c157d769988f2] source-hash-89d01a7d8028ddb765e02c116d202a2435894217
git bisect bad 1d4980621741d3050a5fe61b247c157d769988f2
# bad: [ba096f438393091574da98fe7b8e6b05182a8971] source-hash-8499e78ca03c792f4fa2650e02b519094ba0baa8
git bisect bad ba096f438393091574da98fe7b8e6b05182a8971
# bad: [9daa289e178460daaafa4b3911031df5b8736218] source-hash-704292996a3731a61339b1a4a5c90c9403aa095f
git bisect bad 9daa289e178460daaafa4b3911031df5b8736218
# skip: [69bf614869471f46413fe1d2af5976b2e6d85084] source-hash-76dea8b2db906156e77f78738a68f932a15afd4b
git bisect skip 69bf614869471f46413fe1d2af5976b2e6d85084
# bad: [5997ef2caf7fc40b8899eab0100042836d2db030] source-hash-5e5f3671f8448ee21b00f0d2a08b214e61f7f744
git bisect bad 5997ef2caf7fc40b8899eab0100042836d2db030
# good: [d4078738db5f3c995eff2987d3ebdb0ac0aaf3ce] source-hash-3d5fb88cc0aa8ee6be6cec5ce0255f1412368519
git bisect good d4078738db5f3c995eff2987d3ebdb0ac0aaf3ce
# skip: [fa729323917d7e0d45129bc21c08d8e19faab69b] source-hash-7275a051677b5646e56623b3addc783880ce8e9b
git bisect skip fa729323917d7e0d45129bc21c08d8e19faab69b
# skip: [70cea68b2de84c293ea8adbe2de81f75c23d0beb] source-hash-4a143c44fe7ad266ab9ab7dca317b0099b1438d0
git bisect skip 70cea68b2de84c293ea8adbe2de81f75c23d0beb
# skip: [89d00e8a0afc7c82d82ff03a140cfb2c0555e595] source-hash-af9e58d6de158eb8f479f26c77c5e71e95b96881
git bisect skip 89d00e8a0afc7c82d82ff03a140cfb2c0555e595
# only skipped commits left to test
# possible first bad commit: [5997ef2caf7fc40b8899eab0100042836d2db030] source-hash-5e5f3671f8448ee21b00f0d2a08b214e61f7f744
# possible first bad commit: [89d00e8a0afc7c82d82ff03a140cfb2c0555e595] source-hash-af9e58d6de158eb8f479f26c77c5e71e95b96881
# possible first bad commit: [69bf614869471f46413fe1d2af5976b2e6d85084] source-hash-76dea8b2db906156e77f78738a68f932a15afd4b
# possible first bad commit: [fa729323917d7e0d45129bc21c08d8e19faab69b] source-hash-7275a051677b5646e56623b3addc783880ce8e9b
# possible first bad commit: [70cea68b2de84c293ea8adbe2de81f75c23d0beb] source-hash-4a143c44fe7ad266ab9ab7dca317b0099b1438d0
Comment 5 vvort 2014-09-14 12:45:48 UTC
Created attachment 106258 [details]
Image extracted from test pdf

This is not a problem with PDF import.
If you drag this image into empty LO.Draw document, you will see the same effect.
And image is not damaged. Zoom in and you will see. It is just bad resampling.
Comment 6 Kevin Suo 2014-11-26 08:32:15 UTC
(In reply to vvort from comment #5)
Yes you are correct. I revised the Summay accordingly.
Comment 7 Matthew Francis 2014-12-29 13:49:00 UTC
This bug has been bibisected but apparently not yet source bisected. Adjusting Whiteboard and Keywords to suit.
Comment 8 Matthew Francis 2015-09-06 06:14:20 UTC
This seems to have started at the below commit.
Adding Cc: to caolanm@redhat.com; Could you possibly take a look at this one? Thanks

    commit 45a8eaf9c55f2686f69118641d8a8992a86dfe31
    Author:     Armin Le Grand <alg@apache.org>
    AuthorDate: Mon Jan 14 13:02:48 2013 +0000
    Commit:     Caolán McNamara <caolanm@redhat.com>
    CommitDate: Thu Jun 13 15:46:44 2013 +0100
        Resolves: #i121534# Adapted rotated bitmap paints to use own transformer...
        due to bad quality of GraphicManager paints
        (cherry picked from commit f4887567cc71dca520d57cb6ff2b40eb49142cda)
        Change-Id: Ie4b5873cdfb8bc7f1f4b288e1f983672343d8847
Comment 9 Robinson Tryon (qubit) 2015-12-13 11:10:58 UTC Comment hidden (obsolete)
Comment 10 Xisco Faulí 2016-09-26 15:03:09 UTC
Adding Cc: to Armin Le Grand
Comment 11 Xisco Faulí 2016-10-11 09:30:21 UTC
*** Bug 75715 has been marked as a duplicate of this bug. ***
Comment 12 paulystefan 2017-09-01 20:52:00 UTC
bug also in

Version: (x64)
Build-ID: 7556cbc6811c9d992f4064ab9287069087d7f62c
CPU-Threads: 4; Betriebssystem:Windows 6.19; UI-Render: GL; 
Gebietsschema: de-DE (de_DE); Calc: CL
Comment 13 paulystefan 2017-11-27 20:02:17 UTC
not solved in 64bit win10

same picture like in Colors to greyscale

solved 64bit win10

now all ok in my opinion no difference by scale 100% to acrobat reader