{"id":13527924,"url":"https://github.com/javierbyte/visual-center","last_synced_at":"2025-05-15T18:11:10.478Z","repository":{"id":37742926,"uuid":"58615799","full_name":"javierbyte/visual-center","owner":"javierbyte","description":"Tool to better align logos in the center of a container.","archived":false,"fork":false,"pushed_at":"2024-03-01T02:04:40.000Z","size":8677,"stargazers_count":1432,"open_issues_count":3,"forks_count":47,"subscribers_count":24,"default_branch":"main","last_synced_at":"2025-03-31T23:37:20.792Z","etag":null,"topics":["art","design","design-tool","frontend","javascript","pixel","tool","visual-center"],"latest_commit_sha":null,"homepage":"https://javier.xyz/visual-center","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/javierbyte.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2016-05-12T06:51:39.000Z","updated_at":"2025-03-23T02:42:16.000Z","dependencies_parsed_at":"2024-03-03T08:44:00.029Z","dependency_job_id":null,"html_url":"https://github.com/javierbyte/visual-center","commit_stats":{"total_commits":72,"total_committers":3,"mean_commits":24.0,"dds":0.04166666666666663,"last_synced_commit":"f5f627d5821877877a15b20fc90749ec7fcdabc0"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javierbyte%2Fvisual-center","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javierbyte%2Fvisual-center/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javierbyte%2Fvisual-center/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javierbyte%2Fvisual-center/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/javierbyte","download_url":"https://codeload.github.com/javierbyte/visual-center/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247755560,"owners_count":20990620,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["art","design","design-tool","frontend","javascript","pixel","tool","visual-center"],"created_at":"2024-08-01T06:02:06.838Z","updated_at":"2025-04-08T00:39:37.993Z","avatar_url":"https://github.com/javierbyte.png","language":"JavaScript","readme":"# [Visual Center](https://javier.xyz/visual-center/)\n\nTool that will find the visual center of your images / logos.\n\n[![visual-center](public/javier-xyz-visual-center.jpg)](https://javier.xyz/visual-center/)\n\n## How it works.\n\nIt calculates a visual weight value for every pixel on the image: the square\nroot of the difference between that pixel and the background color. And then the\nalgorithm tries to balance that weight in all directions.\n\nWhy the square root?\nhttp://spectrum.ieee.org/podcast/biomedical/bionics/does-the-brain-work-logarithmically\n\n## Programmatic Usage.\n\n```\nnpm install visual-center --save\n```\n\n```js\nconst getVisualCenter = require('visual-center')\n\ngetVisualCenter(\u003cimgSrc\u003e, function(err, result) {\n  /*\n    results in an object with the data as:\n      {\n        visualTop: \u003cVisual center for Y axis, from 0 to 1\u003e\n        visualLeft: \u003cVisual center for X axis, from 0 to 1\u003e\n        bgColor: \u003cThe background color that we detected\u003e\n        width: \u003cThe width of the image\u003e\n        height: \u003cThe height of the image\u003e\n      }\n  */\n})\n```\n\n## License\n\nBSD-3-Clause License\n","funding_links":[],"categories":["JavaScript","Tools"],"sub_categories":["React Components"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavierbyte%2Fvisual-center","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjavierbyte%2Fvisual-center","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavierbyte%2Fvisual-center/lists"}