Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hand-optimizations for size #1020

Closed
wants to merge 0 commits into from
Closed

Hand-optimizations for size #1020

wants to merge 0 commits into from

Conversation

aschaap
Copy link

@aschaap aschaap commented Apr 6, 2023

Some optimization types are separated into their own commit, in case these are found to be objectionable.

No new icons, just size reductions where the final result is effectively or exactly identical.

Relevant issue: #902

@github-actions
Copy link

github-actions bot commented Apr 6, 2023

Added or changed icons

Icon X-rays icons/activity.svg icons/airplay.svg icons/album.svg icons/alert-circle.svg icons/alert-triangle.svg icons/align-center.svg icons/align-horizontal-space-around.svg icons/align-justify.svg icons/align-left.svg icons/align-right.svg icons/align-vertical-space-around.svg icons/annoyed.svg icons/arrow-big-down.svg icons/arrow-big-up.svg icons/arrow-down-circle.svg icons/arrow-down-left.svg icons/arrow-down-right.svg icons/arrow-down.svg icons/arrow-left-circle.svg icons/arrow-left.svg icons/arrow-right-circle.svg icons/arrow-right.svg icons/arrow-up-circle.svg icons/arrow-up-left.svg icons/arrow-up-right.svg icons/arrow-up.svg icons/asterisk.svg icons/award.svg icons/axis-3d.svg icons/banknote.svg icons/baseline.svg icons/battery-full.svg icons/battery-low.svg icons/battery-medium.svg icons/battery.svg icons/bell.svg icons/bookmark-minus.svg icons/bookmark-plus.svg icons/bookmark.svg icons/bot.svg icons/box.svg icons/briefcase.svg icons/building.svg icons/calendar-check.svg icons/calendar-days.svg icons/calendar-range.svg icons/calendar-x.svg icons/calendar.svg icons/check-check.svg icons/check-circle-2.svg icons/check-circle.svg icons/check-square.svg icons/check.svg icons/chevron-down.svg icons/chevron-first.svg icons/chevron-last.svg icons/chevron-left.svg icons/chevron-right.svg icons/chevron-up.svg icons/chevrons-down-up.svg icons/chevrons-down.svg icons/chevrons-left-right.svg icons/chevrons-left.svg icons/chevrons-right-left.svg icons/chevrons-right.svg icons/chevrons-up-down.svg icons/chevrons-up.svg icons/circle-ellipsis.svg icons/clock-1.svg icons/clock-10.svg icons/clock-11.svg icons/clock-12.svg icons/clock-2.svg icons/clock-3.svg icons/clock-4.svg icons/clock-5.svg icons/clock-6.svg icons/clock-7.svg icons/clock-8.svg icons/clock-9.svg icons/clock.svg icons/cloud-drizzle.svg icons/cloud-fog.svg icons/cloud-hail.svg icons/cloud-off.svg icons/cloud-rain-wind.svg icons/cloud-rain.svg icons/cloud-snow.svg icons/cloud.svg icons/code-2.svg icons/code.svg icons/codesandbox.svg icons/columns.svg icons/command.svg icons/component.svg icons/contrast.svg icons/copy.svg icons/copyleft.svg icons/copyright.svg icons/corner-down-right.svg icons/corner-left-down.svg icons/corner-left-up.svg icons/corner-right-down.svg icons/corner-right-up.svg icons/corner-up-left.svg icons/corner-up-right.svg icons/cpu.svg icons/credit-card.svg icons/crop.svg icons/crosshair.svg icons/crown.svg icons/currency.svg icons/dice-1.svg icons/dice-2.svg icons/dice-3.svg icons/dice-4.svg icons/dice-5.svg icons/dice-6.svg icons/diff.svg icons/divide-circle.svg icons/divide-square.svg icons/divide.svg icons/download-cloud.svg icons/download.svg icons/edit-2.svg icons/edit-3.svg icons/equal-not.svg icons/equal.svg icons/facebook.svg icons/fast-forward.svg icons/file-axis-3d.svg icons/file-badge-2.svg icons/file-check.svg icons/file-cog-2.svg icons/file-diff.svg icons/file-line-chart.svg icons/file-lock.svg icons/file-minus.svg icons/file-plus.svg icons/file-question.svg icons/file-search-2.svg icons/file-terminal.svg icons/file-up.svg icons/file-video.svg icons/file-warning.svg icons/file-x.svg icons/file.svg icons/film.svg icons/filter.svg icons/flag.svg icons/focus.svg icons/form-input.svg icons/forward.svg icons/frame.svg icons/framer.svg icons/function-square.svg icons/git-branch-plus.svg icons/git-branch.svg icons/git-commit.svg icons/git-compare.svg icons/git-fork.svg icons/git-merge.svg icons/git-pull-request-closed.svg icons/git-pull-request-draft.svg icons/git-pull-request.svg icons/globe.svg icons/graduation-cap.svg icons/grape.svg icons/grid.svg icons/grip-horizontal.svg icons/grip-vertical.svg icons/hash.svg icons/heading.svg icons/help-circle.svg icons/hexagon.svg icons/history.svg icons/home.svg icons/image.svg icons/info.svg icons/instagram.svg icons/joystick.svg icons/keyboard.svg icons/lamp-floor.svg icons/laptop-2.svg icons/layout-dashboard.svg icons/layout-grid.svg icons/layout-list.svg icons/layout-template.svg icons/layout.svg icons/library.svg icons/life-buoy.svg icons/line-chart.svg icons/list-checks.svg icons/list-minus.svg icons/list-ordered.svg icons/list-plus.svg icons/list.svg icons/loader-2.svg icons/loader.svg icons/locate-fixed.svg icons/locate.svg icons/lock.svg icons/log-in.svg icons/log-out.svg icons/martini.svg icons/maximize.svg icons/megaphone.svg icons/meh.svg icons/menu.svg icons/message-circle.svg icons/message-square.svg icons/microwave.svg icons/minimize.svg icons/minus-circle.svg icons/minus-square.svg icons/minus.svg icons/monitor.svg icons/moon.svg icons/more-horizontal.svg icons/more-vertical.svg icons/mouse-pointer.svg icons/mouse.svg icons/move-3d.svg icons/move-diagonal-2.svg icons/move-diagonal.svg icons/move-horizontal.svg icons/move-vertical.svg icons/move.svg icons/navigation-2.svg icons/navigation.svg icons/network.svg icons/option.svg icons/outdent.svg icons/package.svg icons/pause-circle.svg icons/pause.svg icons/pencil.svg icons/percent.svg icons/pie-chart.svg icons/pilcrow.svg icons/play-circle.svg icons/play.svg icons/plus-circle.svg icons/plus-square.svg icons/plus.svg icons/power.svg icons/radio-receiver.svg icons/redo-2.svg icons/redo.svg icons/refresh-ccw.svg icons/refresh-cw.svg icons/regex.svg icons/repeat.svg icons/reply.svg icons/rewind.svg icons/rotate-ccw.svg icons/rotate-cw.svg icons/rss.svg icons/scale-3d.svg icons/scan-face.svg icons/scan-line.svg icons/scan.svg icons/search.svg icons/send.svg icons/separator-horizontal.svg icons/separator-vertical.svg icons/server.svg icons/settings-2.svg icons/share-2.svg icons/share.svg icons/sheet.svg icons/shield-alert.svg icons/shield-check.svg icons/shield-close.svg icons/shield.svg icons/sidebar-close.svg icons/sidebar-open.svg icons/sidebar.svg icons/signal-high.svg icons/signal-low.svg icons/signal-medium.svg icons/signal-zero.svg icons/signal.svg icons/skip-back.svg icons/skip-forward.svg icons/slack.svg icons/slash.svg icons/smartphone-charging.svg icons/smartphone.svg icons/speaker.svg icons/spline.svg icons/square.svg icons/star-half.svg icons/stop-circle.svg icons/stretch-horizontal.svg icons/stretch-vertical.svg icons/sun-dim.svg icons/sun-medium.svg icons/sun-moon.svg icons/sun.svg icons/swiss-franc.svg icons/table-2.svg icons/table.svg icons/tablet.svg icons/terminal-square.svg icons/terminal.svg icons/thermometer.svg icons/timer.svg icons/train.svg icons/trash-2.svg icons/trash.svg icons/trello.svg icons/trending-down.svg icons/trending-up.svg icons/triangle.svg icons/tv.svg icons/twitch.svg icons/underline.svg icons/undo-2.svg icons/undo.svg icons/unlink-2.svg icons/unlock.svg icons/upload-cloud.svg icons/upload.svg icons/user-check.svg icons/user-cog.svg icons/user-minus.svg icons/user-plus.svg icons/user-x.svg icons/user.svg icons/users.svg icons/vibrate.svg icons/video.svg icons/voicemail.svg icons/volume-1.svg icons/volume-2.svg icons/volume-x.svg icons/volume.svg icons/wand.svg icons/waves.svg icons/webcam.svg icons/wheat.svg icons/wifi.svg icons/x-circle.svg icons/x-square.svg icons/x.svg icons/zap.svg icons/zoom-in.svg icons/zoom-out.svg

@aschaap
Copy link
Author

aschaap commented Apr 6, 2023

I see <use /> is not rendered properly by the GitHub Action.

@karsa-mistmere
Copy link
Member

@aschaap: I've found multiple instances where separate paths have been merged into a single one, this is something we've deliberately chosen not to do as such compound paths sometimes render incorrectly in Figma amongst others.

(E.g. the two separate lines of arrows have been merged).

@karsa-mistmere
Copy link
Member

I see is not rendered properly by the GitHub Action.

Not sure we even have support for <use> in general, it might also break font outlining, we'll have to check.

@aschaap
Copy link
Author

aschaap commented Apr 6, 2023

@aschaap: I've found multiple instances where separate paths have been merged into a single one, this is something we've deliberately chosen not to do as such compound paths sometimes render incorrectly in Figma amongst others.

(E.g. the two separate lines of arrows have been merged).

Interesting, I found you in #936 mentioning Figma also does not render zero-length paths with caps as dots.

Is this decision to avoid compound paths (and any others like it) documented anywhere beyond the Readme/website? I.e., are there other Figma limitations to be aware of, and are there other similarly limited use cases to support?

@karsa-mistmere
Copy link
Member

Is this decision to avoid compound paths (and any others like it) documented anywhere beyond the Readme/website?

It isn't, but I guess we should probably add this (and some others) to the icon design guide, thanks for bringing this to my attention. In fact the guidelines are in dire need of some rewrite anyway: #650

@aschaap
Copy link
Author

aschaap commented Apr 6, 2023

Thank you for the quick response. I found a generic 'improve SVG support' https://forum.figma.com/t/improve-svg-support/2505 dating back to April 2021. Do you know whether there is an issue for the Figma SVG path problems?

If Figma's SVG support is an outlier, would it make sense to adapt the package exporter to separate the combined paths instead?

@jguddas
Copy link
Member

jguddas commented Apr 8, 2023

I'm working on automating some of those optimizations.
One question, which elements are preferred over path?

My opinion:

  • rect, circle, ellipse should be used instead of path.
  • path should be used instead of line, polygon, polyline.

You can already do things like decompounding and converting line, polygon, polyline to path using https://lucide-site-git-feat-added-edit-page-jguddas.vercel.app/edit.

But I haven't built the path to rect/circle/ellipse feature, and I wanted to ask your opinion first.

Edit: it also fixes zero length paths.

@aschaap
Copy link
Author

aschaap commented Apr 10, 2023

@jguddas : I agree with your opinion, but would add nuance to the preference of rect over path: rect with rx is shorter than the equivalent path with arcs, but without rx a path is often shorter.

As for circle, I'm not sure one can create a truly equivalent path; converting path' to circle' would require some loss of precision/approximate matching.

@ericfennis
Copy link
Member

@aschaap Can you rebase, your PR. I opmized the rest of the icons, so this PR should be a bit cleaner now.

@aschaap
Copy link
Author

aschaap commented Apr 15, 2023

@ericfennis Your optimization PR #1025 seems to only rearrange attributes? If you used a tool for this, would it make sense to solve all the merge conflicts it creates? It would seem easier to reapply them after this PR, unless I'm missing something.

@ericfennis
Copy link
Member

@aschaap I thought you were optimizing the icons by accident. So I thought to do it I a separate PR we could see you changes better. Are your changes now gone after rebasing?

@aschaap
Copy link
Author

aschaap commented Apr 17, 2023

I optimized icons with the intention of doing so (along with learning more of the SVG Path spec). Rebasing does not eliminate my changes, and is taking time due to having to merge it with rearranged attributes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants