Is Bitmap2Component inaccurate (?)

Bug #747631 reported by Stephen Bernhoeft
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
High
Unassigned

Bug Description

I think that Bitmap2Component is inaccurate. For example, input file is 350dpi, 972 Pixels heigh.
...................................................
972 Pixels heigh, 350 dpi --> 2.777142857 inches
                           --> 70.53942857 mm
...................................................
KiCad --> 82.54 mm
...................................................
Thus, Bitmap2Component has stretched the original image by ~17%.

Another test, a 1" square, 350dpi, 350px * 350px
This comes out at 1.165" square as measured in KiCad.

Revision history for this message
Stephen Bernhoeft (reg-abelgratis) wrote :
Revision history for this message
Martin Errenst (imp-d) wrote :

I can confirm this bug, (still) happens with:
Application: Pcbnew
Version: (2014-02-22 BZR 4713)-product Release build
wxWidgets: Version 3.0.0 (debug,wchar_t,compiler with C++ ABI 1002,GCC 4.7.3,wx containers,compatible with 2.8)
Platform: Linux 3.9.2-gentoo x86_64, 64 bit, Little endian, wxGTK
Boost version: 1.54.0
         USE_WX_GRAPHICS_CONTEXT=OFF
         USE_WX_OVERLAY=OFF
         KICAD_SCRIPTING=OFF
         KICAD_SCRIPTING_MODULES=OFF
         KICAD_SCRIPTING_WXPYTHON=OFF
         USE_FP_LIB_TABLE=HARD_CODED_ON
         BUILD_GITHUB_PLUGIN=OFF

tags: added: bitmap2component footprint pcbnew
Changed in kicad:
status: New → Confirmed
Revision history for this message
Martin Errenst (imp-d) wrote :

Patch to read the DPIs / resolution from loaded image and pass it into the export functions as parameters. Not perfect but it'll be closer to the real resolution compared to always using 300. (Using doubles for calculating the DPI values will not fix this problem, the dots per cm reported for the bitmap from above is 137, 137*2.54=347.98..., adding 1 ontop of the 137 brings us to 350).

Changed in kicad:
importance: Undecided → High
Revision history for this message
jean-pierre charras (jp-charras) wrote :

I added the management of image resolution in ref 4751.
It is read from file, when exists, and can be modified in bitmap2component.

Your patch helped me to code these changes, thanks.

Changed in kicad:
status: Confirmed → Fix Committed
Jon Neal (reportingsjr)
Changed in kicad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.