GithubHelp home page GithubHelp logo

Comments (11)

xmfcx avatar xmfcx commented on August 27, 2024 1

@kenji-miyake I think we should add a rule in documentation to not allow binary image contributions.

(I don't know if it's practical to add a CI check for this.)

Maybe we can use this https://github.com/ppremk/lfs-warning to prevent them from being contributed.

from autoware.

VRichardJP avatar VRichardJP commented on August 27, 2024 1

I don't know a thing about graphic software, but from a quick google it seems Inkscape has quick auto-vectorization tool:

https://github.com/autowarefoundation/autoware.universe/blob/main/planning/behavior_path_planner/image/lane_change/lane_change-enable_collision_check_at_prepare_phase.png

  • Path > Trace Bitmap...
  • Tab: Multicolor
  • Detection Mode: Color
  • Remove Background

Took me 30 seconds (sorry for dark mode users):
g170

Size before: 7MB
Size after: 650KB

I don't know if it is a very clean SVG, in particular text is not stored as text, but it could be a quick and effective way to reduce image size. The better way would be to have access to the original files.

from autoware.

kenji-miyake avatar kenji-miyake commented on August 27, 2024 1

https://github.com/autowarefoundation/autoware.universe/blob/main/planning/behavior_path_planner/image/avoidance/avoidance_design.fig1.drawio.svg
Has no reason to be this large.

I'm not sure, but it might have some meta data for re-editing in draw.io.

from autoware.

kenji-miyake avatar kenji-miyake commented on August 27, 2024 1

@kenji-miyake I think we should add a rule in documentation to not allow binary image contributions.

@xmfcx I remember you said we can consider utilizing git-lfs for images.
Did you find any problem with git-lfs and change your mind?

(I don't know if it's practical to add a CI check for this.)

If we really disallow image files, I think checking on CI is good.

from autoware.

xmfcx avatar xmfcx commented on August 27, 2024 1

@xmfcx I remember you said we can consider utilizing git-lfs for images.
Did you find any problem with git-lfs and change your mind?

We had a discussion with the Autoware Planning & Control team in the WG meeting.

@kenji-miyake

The common agreement was that the draw.io metadata information (the binary blob) in the files are important for the team. We should keep them.

And to allow this, I had 2 solutions:

  • Add git-lfs support for the image and binary files. (my preference)
  • Replace the .svg files with smaller versions. But collect and host the original .drawio.svg files in some google drive, have links to them in the documentation. (too complicated and hard to maintain)

@esteve do you think adding git-lfs tracking to the generic image files in the middle of repository timeline might have any unknown side effects?

I would like to go with this option but we also need to update the documentation, maybe ansible scripts, maybe for certain CI actions (like mk-docs generation) to have this support.

from autoware.

esteve avatar esteve commented on August 27, 2024 1

@esteve do you think adding git-lfs tracking to the generic image files in the middle of repository timeline might have any unknown side effects?

I don't know of any side effects, but I agree with using git-lfs for storing the .svg files.

from autoware.

xmfcx avatar xmfcx commented on August 27, 2024

For example,
Following file:

https://github.com/autowarefoundation/autoware.universe/blob/main/planning/behavior_path_planner/image/avoidance/avoidance_design.fig1.drawio.svg

Has no reason to be this large.

But it has many binary images inside which can be replaced with vector images.

from autoware.

xmfcx avatar xmfcx commented on August 27, 2024

@VRichardJP thanks, I didn't know Inkscape could do it too.

I could get following in Illustrator following https://helpx.adobe.com/illustrator/using/image-trace.html

Asset 1

I'm not sure, but it might have some meta data for re-editing in draw.io

@kenji-miyake it's likely. Because when I opened the file with Illustrator and just saved it back without doing anything, it got reduced to 25KB.

avoidance_design fig1 drawio

We can still utilize git-lfs, but just for light vector files, it might not be necessary.

from autoware.

kenji-miyake avatar kenji-miyake commented on August 27, 2024

@xmfcx By the way, how critical is this issue? Do you have any specific problems caused by the repository size?

from autoware.

xmfcx avatar xmfcx commented on August 27, 2024

By the way, how critical is this issue? Do you have any specific problems caused by the repository size?

I'd say it has normal priority. Keeping repo small in general is a good practice. And earlier we do this, better it is. Because these binary files keep making the .git folder larger and larger with no return.

I've realized this while investigating why the autoware folder was so large. Then realized these images and it'd be a good thing to do if anyone would like to spare some time.

It'd be the best if people who contributed these files put here the lighter versions instead, since we might lose some quality otherwise.

from autoware.

mehmetdogru avatar mehmetdogru commented on August 27, 2024

@xmfcx agrees on closing the issue.

from autoware.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.