louis-ev / Cargo-Bikes-Size-Comparator

Cargo bike size comparison tool
GNU Affero General Public License v3.0
28 stars 7 forks source link

How to contributes bikes #9

Closed louis-ev closed 2 months ago

louis-ev commented 4 months ago

This issue explains how to contribute a bike to the tool.

  1. find a high resolution photo (bigger than 1000px in both dimensions, ideally) of the bike on a white background

  2. use an online tool to remove that background (such as https://new.express.adobe.com/ ) and download a transparent PNG of the image

  3. in the image, measure horizontally the bike relative to the image width (let's say a bike makes up only 75% of the image width)

  4. measure the margin between the left edge of the image and the left edge of the bike (usually the wheel, sometimes the monkey bars if welded on the bike and if the manufacturer uses the bars when giving the length of the bike), and the bottom edge of the image and the bottom of the wheels.

  5. post here the image and informations, or, if you know your way around git/github, append all this in as a new object in the src/assets/bike_images.json file and send a pull request :

  {
    "id": "chike",
    "id_in_csv": "Chike/Cargo",
    "manufacturer": "Chike",
    "model": "Cargo",
    "src": "CHIKE_e-Kids_2022_taubenblau-scaled-transformed.png",
    "bike_length_percent": 0.86577181,
    "bike_length_cm": 192,
    "left_margin_percent": 0.075,
    "bottom_margin_percent": 0.088,
    "url": "https://chike.de/en/"
  },

Feel free to post here for any questions/help.

Anthony-Bible commented 3 months ago

~How are you getting the percentages? Like for example step 3?~

Edit: I was able to import the image with the background removed into gimp. I then used the measure tool (shift + m) to get the pixel count and then divided that by the size of the image. For anyone looking at this in the future it might help to do vertical and horizontal guides.

You should be able to do the above in photoshop too.

louis-ev commented 3 months ago

Thanks for the feedbacks! Indeed, not very convenient. I am actually working on a small menu to simplify adding a bike: enter the URL to the image (hosted somewhere online, set the right percent value with a slider, then click on this link to send me these values via email so I can double check and add those to the code). See the branch develop-add_bike_local (though a lot of work still needs to be done).

louis-ev commented 3 months ago

The above feature is in place.