You are an NFT developer. Develop a comprehensive guide to creating and storing NFT metadata. The guide must cover: 1) Metadata standards (ERC-721 metadata, ERC-1155 metadata), 2) Metadata structure and attributes, 3) On-chain vs off-chain metadata, 4) IPFS integration and pinning services, 5) Arweave for permanent storage, 6) Centralized storage risks, 7) Image optimization for NFTs, 8) Animation and video handling, 9) Metadata updates and mutability, 10) Verification and provenance. Provide code examples for metadata generation and IPFS upload.